Add worked-example notebook (+ tolerant method-name lookup) - #9
Merged
Conversation
examples/cuperiod_tour.ipynb is a guided tour over real light curves -- a Cepheid (GLS), an RR Lyrae (MHAOV), an eclipsing binary (BLS, with the GLS P/2 trap), a Mira (PDM), and a confirmed Kepler exoplanet (TLS) -- showing for each the raw light curve, the periodogram, and the phase-folded result, plus a multi-method comparison and the N-best peaks. It is self-contained: examples/data/ bundles 6 public ASAS-SN g-band light curves and one Kepler KOI (fetched once via lightkurve), so it runs offline. Outputs are baked in so the plots render on GitHub. Linked from the README and the docs quickstart. While building it, found that the documented "String-Length" spelling raised UnknownMethodError (get_method did name.upper(), but the registry key is "STRINGLENGTH"). get_method, register and MultiResult.__getitem__ now normalize names by uppercasing and dropping non-alphanumerics, so "String-Length" == "StringLength" == "STRINGLENGTH" (and "gls" == "GLS"), matching the docs. Added registry tests. Verified: pytest 139 passed / 2 skipped, ruff + mypy clean, docs -W build clean, notebook executes end-to-end (0 errors, 6 figures). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the noisy composite-type RR Lyrae with ASASSN-V J000003.69+352146.0 (GM And), a clean RRAB (g-band fold scatter ~0.02 mag), fetched from ASAS-SN Sky Patrol. Its ground-based periodogram is dominated by the 1-day alias and integer-period subharmonics, so the MHAOV search is bounded to the physical RR Lyrae range (0.3-1 day) — which recovers the true 0.70675 d and doubles as a teaching point about aliases. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a worked-example Jupyter notebook that teaches cuPeriod on real light curves,
and fixes a small documented-vs-actual method-name bug found while building it.
examples/cuperiod_tour.ipynbA guided tour — for each object it shows raw light curve → periodogram → phase-folded:
examples/data/bundles 6 public ASAS-SN g-band lightcurves (one per variability class, with VSX periods) and one Kepler KOI (fetched once
via lightkurve). No network needed.
examples/is outside the sdistallowlist, so it doesn't bloat the PyPI package.)
Fix: hyphenated method names
The README/docs use
"String-Length", butget_methoddidname.upper()→"STRING-LENGTH"≠ the registry key"STRINGLENGTH", so the documented spelling raisedUnknownMethodError.get_method,register, andMultiResult.__getitem__nownormalize names (uppercase, strip non-alphanumerics):
"String-Length"=="StringLength"=="STRINGLENGTH"(and"gls"=="GLS"). New registry tests cover it.Verification
pytest139 passed / 2 skipped, ruff + mypy clean, docs-Wclean, notebook executesend-to-end (0 errors, 6 figures).
🤖 Generated with Claude Code