Skip to content

docs: add quick how-to example for 1D motif discovery (#1) - #4

Open
Gargeesharmaa wants to merge 4 commits into
stumpy-dev:mainfrom
Gargeesharmaa:add-1d-motif-howto
Open

Gargeesharmaa wants to merge 4 commits into
stumpy-dev:mainfrom
Gargeesharmaa:add-1d-motif-howto

Conversation

@Gargeesharmaa

Copy link
Copy Markdown

Summary

Resolves #1 (Follow-up to stumpy#663).

This PR adds a concise, solution-oriented How-To Example notebook for finding repeating patterns (motifs) in a 1D time series using stumpy.stump.

Following the Diátaxis framework for How-To guides, this notebook is designed for quick reference by experienced users and data scientists who need minimal code and instant results:

  • Problem-focused: Starts with a direct 1–2 sentence problem statement.
  • Minimal Code: Demonstrates data setup, stumpy.stump execution, and top motif extraction in a few lines.
  • Zero Plotting Boilerplate: Focuses purely on the core STUMPY API without extraneous matplotlib setup.
  • Clear Output Explanation: Explains mp[:, 0] (distances) and mp[:, 1] (indices) in a brief concluding section.

Comparison: Old Tutorial Style vs. New How-To Guide

Metric / Aspect Existing Tutorials (stumpy docs) New How-To Guide (awesome-stumpy)
Primary Focus Learning & Concept Acquisition (Tutorial style) Working & Problem Solving (Diátaxis How-To)
User Mindset Beginner exploring matrix profiles for the first time Data scientist with time series data looking for an immediate solution
Code Structure Full data loading, extensive matplotlib visualization code, multi-step pipeline Clean 3-step Python snippet focusing purely on stumpy.stump API
Length & Depth Long, narrative explanations with background theory Brief (2–3 paragraphs total), copy-pasteable solution
Friction to Run Requires installing extra dependencies (e.g., matplotlib, pandas) Minimal dependencies (numpy, stumpy)

Checklist

  • Content follows Diátaxis How-To principles (concise, task-focused, no extra plotting).
  • Tested snippet locally with STUMPY.
  • Added notebook file in proper repository location.

@gitnotebooks

gitnotebooks Bot commented Sep 19, 2026

Copy link
Copy Markdown

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

@seanlaw

seanlaw commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

@Gargeesharmaa Can you please reproduce one of the examples in this PDF file?

@Gargeesharmaa

Copy link
Copy Markdown
Author

Hi @seanlaw! Absolutely.

I will adapt this notebook to directly reproduce Question 1 from the 100 Time Series Data Mining Questions PDF ("How do I find the most similar pair of time series sub-sequences / motifs?").

I'll update the notebook structure and push the commit shortly!

@seanlaw

seanlaw commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

I will adapt this notebook to directly reproduce Question 1 from the 100 Time Series Data Mining Questions PDF

@Gargeesharmaa I would prefer your notebook were to reproduce slide 3. When you look at the slide itself, they demonstrate everything using 4 lines of code. I think our example should feel similar. We may need more code to plot things but the complexity of the code should be similar. Finally, we should be using examples where the data is readily available

@Gargeesharmaa

Copy link
Copy Markdown
Author

Got it, @seanlaw! I'll update the notebook to reproduce Slide 3 using a readily available dataset, keeping the core STUMPY logic to ~4 lines of code along with the corresponding plot. I'll push the updated notebook shortly!

@Gargeesharmaa

Copy link
Copy Markdown
Author

Hi @seanlaw! I've updated the notebook to reproduce Slide 3:

  • Uses a publicly available dataset (TCB_daily.csv).
  • Core STUMPY execution is kept to ~4 lines.
  • Includes a clean 2-panel plot showing the time series and matrix profile with motif indicators.

Ready for your review!

@seanlaw

seanlaw commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

@Gargeesharmaa Please find and use the same/identical dataset as slide 3. Please do not deviate from slide 3. Additionally, you mention red dashes but there is no plot displayed. Finally address all errors before requesting a review.

@Gargeesharmaa

Copy link
Copy Markdown
Author

Hi @seanlaw! Thank you for the feedback.

I have updated the notebook:

Identical Dataset: Switched directly to the Slide 3 dataset (robot_dog.txt / carpet_query.txt).

Code Simplicity: Kept the core query match logic concise using stumpy.mass.

Plot Output: Executed the notebook locally so the 2-panel plot (with red dashed lines) is saved and renders properly in the PR preview.

Ready for your re-review!

@seanlaw

seanlaw commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Plot Output: Executed the notebook locally so the 2-panel plot (with red dashed lines) is saved and renders properly in the PR preview.

Where are the plots? There are no plots displayed

Finally address all errors before requesting a review.

There are still persistent errors that need to be resolved before requesting review

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.

Add notebooks for 100_Time_Series_Data_Mining_Questions__with_Answers.pdf

2 participants