Skip to content

Fix outdated Tutorial_DiscordMERLIN.ipynb#1156

Closed
ShreyasK06 wants to merge 1 commit into
stumpy-dev:mainfrom
ShreyasK06:fix/tutorial-discord-merlin
Closed

Fix outdated Tutorial_DiscordMERLIN.ipynb#1156
ShreyasK06 wants to merge 1 commit into
stumpy-dev:mainfrom
ShreyasK06:fix/tutorial-discord-merlin

Conversation

@ShreyasK06

Copy link
Copy Markdown

This PR fixes docs/WIP/Tutorial_DiscordMERLIN.ipynb, which was broken in several ways due to API changes and dependency updates since it was originally written. All changes are scoped strictly to the notebook file.

Fix 1 — core.preprocess now returns 4 values
Updated every T, M_T, Σ_T = core.preprocess(...) call to the correct 4-value unpack (T, M_T, Σ_T, T_subseq_isconstant = core.preprocess(...)), and threaded T_subseq_isconstant through _find_candidates, _get_approx_P, and _refine_candidates so it is passed correctly to core._mass and _prescrump.

Fix 2 — Dead dataset URLs replaced

  • NoisySine dataset: original source is gone and no working URL exists. Replaced with a self-contained synthetic signal (sinusoid + noise + spike anomaly) generated with NumPy. No new dependencies required.
  • NYC taxi dataset: replaced broken local path with the Zenodo URL provided by the maintainer (https://zenodo.org/record/4276428/files/STUMPY_Basics_Taxi.csv?download=1).

Fix 3 — core._sliding_dot_product renamed
Updated both call sites in _find_candidates and _refine_candidates from core._sliding_dot_product to core.sliding_dot_product.

Fix 4 — np.NINF removed in NumPy 2.0
Replaced all 8 runtime occurrences of np.NINF across _refine_candidates, the MP verification block, _discords, and stumpy_top_k_discords with -np.inf. Occurrences in docstrings and comments were left untouched. No logic changes.

Known issue — pending review discussion
The notebook still fails at out = _discords(T, m, k=15) with:
ValueError: could not broadcast input array from shape (1489,1489) into shape (1489,)
This is caused by stumpy.scrump._prescrump now returning a 2D (l, k) array instead of the 1D (l,) shape _get_approx_P expects. Fix is pending maintainer input.

Closes #1127

@ShreyasK06
ShreyasK06 requested a review from seanlaw as a code owner July 20, 2026 16:45
@gitnotebooks

gitnotebooks Bot commented Jul 20, 2026

Copy link
Copy Markdown

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1156

@github-actions

Copy link
Copy Markdown

❌ This pull request has been automatically closed because the mandatory PR template was removed or not filled out. Please reopen or recreate this PR with the required information.

@github-actions github-actions Bot closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs/WIP/Tutorial_DiscordMERLIN.ipynb is outdated

1 participant