Repository navigation
Fix the Read the Docs build and remove the numpy<1.23 requirement - #33
Merged
Merged
Conversation
The documentation source on master has been correct since the docs rewrite, but https://scintools.readthedocs.io still served an old build (complete with the "blah blah this is how you do things" placeholder) because every Read the Docs build was failing. Four separate problems: 1. No .readthedocs.yaml. Read the Docs has required a config file since September 2023; without one the build fails and the last successful build keeps being served. Added, pinning Python 3.11 and installing both the doc requirements and the package itself. 2. jupyter_sphinx was not installed. conf.py does `extensions += ['jupyter_sphinx']`, so Sphinx aborted with an ExtensionError before rendering anything. Added docs/requirements.txt with sphinx, sphinx_rtd_theme, jupyter_sphinx and ipykernel. 3. scintools was not importable during the build, which broke autodoc in reference.rst. conf.py added docs/source to sys.path (via os.path.abspath('.')) rather than the repository root. Now resolved relative to __file__ so it does not depend on the working directory. The jupyter-execute cells run in a separate kernel and do not inherit this, which is why .readthedocs.yaml also installs the package. 4. The theta-theta tutorials added unseeded noise (np.random.normal(0, 20, ...)) and then fit an arc to it, so the build was non-deterministic and could fail outright with "Fit returned a forward parabola". Seeded the noise in both tutorials. Verified this failure predates the recent bug-fix work: the same code path on the pre-rewrite master returns bit-identical results. Also: stop tracking docs/build (48 stale artifacts, including the committed HTML containing the old placeholder text) and add it to .gitignore, and replace the deprecated `language = None` with 'en'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EG6cv3jHNLYv1TN2YWDqi3
The jupyter-execute cells in the theta-theta tutorials run in a separate IPython kernel subprocess, which does not inherit the sys.path entry that conf.py adds for autodoc, so they still failed with "ModuleNotFoundError: No module named 'scintools'". Installing the package on Read the Docs would fix the import but pulls in setup.py's `numpy<1.23.0` pin. Verified locally that `pip install .` silently downgrades numpy (2.4.6 -> 1.22.4); numpy 1.22 has no wheels for Python 3.11, so that would break the docs environment. Instead, conf.py now also exports PYTHONPATH so the kernel subprocess can import scintools from the source tree, and docs/requirements.txt lists the runtime dependencies (numpy, scipy, matplotlib, astropy, lmfit) explicitly rather than installing the package. .readthedocs.yaml no longer performs a pip install of the project. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EG6cv3jHNLYv1TN2YWDqi3
The pin dated from before the package supported NumPy 2. It forced users onto a three-year-old NumPy that has no wheels for Python 3.11+, and installing scintools would silently downgrade a working environment (verified: pip install . took numpy 2.4.6 -> 1.22.4, which in turn downgraded astropy and left scipy/pandas binary-incompatible). The incompatibility the pin was working around has since been fixed: np.complex_ (removed in NumPy 2.0) is now np.complex128, and np.float128 is now np.longdouble. No version-conditional code remains. Verified on numpy 2.4.6: the full test suite passes (74 tests), the ACF class and the analytic 2D ACF path work, and a complete Dynspec pipeline (trim_edges / refill / correct_dyn / calc_sspec / calc_acf / get_scint_params) runs end to end. CI additionally covers Python 3.8-3.10, where the resolver picks the newest NumPy valid for each. Also updates the docs build comments, which previously cited the pin as the reason for not installing the package on Read the Docs; the remaining reason is simply to keep the docs environment small. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EG6cv3jHNLYv1TN2YWDqi3
With the import problems fixed, the build got as far as executing the tutorials and then ran for over 25 minutes without finishing. The two theta-theta tutorials use `jupyter-execute`, so a full theta-theta analysis of the sample data runs on every build; that exceeds the Read the Docs build limit, so the build would still have timed out and left stale documentation published. Excluding them takes the build from >25 minutes (never completing) to 7 seconds, exit 0, with every other page rendered correctly. Nothing is lost relative to what is currently published: the last successful build on Read the Docs predates these tutorials and never contained them. The tutorial sources stay in the repository, and thetatheta.rst now points readers at them and explains why they are not rendered. To publish them again, pre-render their output rather than executing on every build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EG6cv3jHNLYv1TN2YWDqi3
danielreardon
commented
Jul 31, 2026
danielreardon
left a comment
Owner
Author
There was a problem hiding this comment.
All documentation changes look good
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.
Why
https://scintools.readthedocs.io still shows the old placeholder text ("blah blah this is how you do things") even though the documentation source on
masterhas been correct since the docs rewrite. The source was never the problem — every Read the Docs build was failing, so RTD kept serving the last build that succeeded, which predates the rewrite.I found four independent failures, each of which had to be fixed before the next became visible.
The four build failures
No
.readthedocs.yaml. RTD has required a config file since September 2023; without one the build fails outright. This alone explains the frozen page.jupyter_sphinxwas never installed.conf.pydoesextensions += ['jupyter_sphinx'], so Sphinx aborted with anExtensionErrorbefore rendering anything.scintoolswas not importable during the build.conf.pyaddeddocs/sourcetosys.path(viaos.path.abspath('.')) rather than the repository root, soautodocinreference.rstfailed. Now resolved relative to__file__, so it no longer depends on the working directory. Separately, thejupyter-executecells run in a separate IPython kernel subprocess that does not inheritsys.path, soconf.pynow also exportsPYTHONPATH.The build exceeded the RTD time limit. With the imports fixed, the build reached the theta-theta tutorials and ran for over 25 minutes without finishing, because
jupyter-executeruns a full theta-theta analysis on every build. Excluding those two tutorials takes the build to 7 seconds, exit 0, with every other page rendering correctly.Removing the numpy pin
setup.pypinnednumpy<1.23.0. This was not harmless: runningpip install .downgraded numpy 2.4.6 → 1.22.4 in a working environment, which pulled astropy back with it and left scipy/pandas binary-incompatible. numpy 1.22 also has no wheels for Python 3.11+.The incompatibility the pin worked around has already been fixed (
np.complex_→np.complex128,np.float128→np.longdouble); no version-conditional code remains. Verified on numpy 2.4.6: the full test suite passes (74 tests), theACFclass and analytic 2D ACF path work, and a completeDynspecpipeline (trim_edges/refill/correct_dyn/calc_sspec/calc_acf/get_scint_params) runs end to end.Also included
np.random.normal(0, 20, ...)) and then fit an arc to it, making the build non-deterministic — it could fail outright withValueError: Fit returned a forward parabola. Both are now seeded. I confirmed this flakiness predates the recent bug-fix work: the same code path on pre-rewritemasterreturns bit-identical results.docs/build/was committed (48 stale artifacts, including the HTML containing the old placeholder). Now untracked and gitignored.language = None→'en'(deprecated in modern Sphinx).Verification
Built exactly as RTD will:
scintoolsuninstalled,PYTHONPATHcleared.dynspec.htmlcontains no placeholder text and includes the new content;reference.htmlshows autodoc is working (it picks upcalc_sspec,prep_thetatheta, andsvd_reconstruct).Notes for review
thetatheta.rstnow points readers at them. To publish them again, pre-render their output rather than executing on every build.dynspec.py, "Missing matching underline" inththmod.errString). These were invisible before because autodoc could never import the package. They do not fail the build; worth a follow-up.🤖 Generated with Claude Code
Generated by Claude Code