You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A HowToFit chapter 1 read-through on 2026-09-14 hit ModuleNotFoundError: No module named 'dynesty' (tutorial 4) and 'emcee' (tutorials 5 and 6) on Colab: autonerves/setup_colab.py installed its package list with pip install *packages --no-deps, and neither sampler was named in _SHARED_EXTRAS, so neither could arrive transitively via autofit. Every Colab notebook across all six _PROJECTS that runs a Dynesty or Emcee search died at the fit.
The code half already shipped the same day in #164 (merged, 8336939), which added emcee>=3.1.6 and dynesty==2.1.5 to _SHARED_EXTRAS with the specifiers autofit declares, plus a comment recording why a --no-deps install has to name its siblings' real dependencies. What did not ship is the regression test.#164 was verified only against the existing suite, which asserts nothing about the contents of _SHARED_EXTRAS — test_setup_colab.py checks only spec["packages"][0] == "autonerves". Nothing currently stops a future edit dropping a sampler again, which is exactly how this bug arose.
Note: Colab notebooks pip install autonerves fresh on every run, so #164 reaches users only once a new autonerves is released to PyPI.
Plan
Cover the shipped fix with a regression test: every _PROJECTS entry must resolve to a packages list containing dynesty, emceeandnautilus-sampler — the three samplers PyAutoFit exposes as af.DynestyStatic, af.Emcee and af.Nautilus. Assert on sampler names, not exact pins, so a version bump does not break the test.
Because the install is --no-deps, confirm the two newly-named samplers' own runtime requirements are already present in a stock Colab image (dynesty needs numpy + scipy, emcee needs numpy) — otherwise they install but still fail at import.
Consider (judgement call, not a given) lifting the three samplers out of _SHARED_EXTRAS into their own _SAMPLERS list: a missing sampler is a hard ModuleNotFoundError at fit time, not a degraded experience, so the grouping arguably should say so.
Keep in view, but out of scope: a broader audit of autofit's declared dependencies against a stock Colab image would say whether others are waiting behind the same --no-deps trap.
The install at ~line 277 is still subprocess.check_call([sys.executable, "-m", "pip", "install", *packages, "--no-deps"]), so the --no-deps constraint that caused the bug is unchanged and is the thing the test defends.
Implementation Steps
Add the regression test in test_autonerves/test_setup_colab.py, in class TestRegistry alongside test_all_projects_have_required_fields. For every entry of setup_colab._PROJECTS ("autofit", "autogalaxy", "autolens", "howtofit", "howtogalaxy", "howtolens"), assert the resolved packages list contains dynesty, emcee and nautilus-sampler. Match on the requirement name (split each entry on the version specifier — ==, >=, <, ~= — before comparing) so a pin bump does not break the test, and fail with the project name in the message.
Confirm the --no-deps runtime requirements hold.dynesty needs numpy + scipy; emcee needs numpy. Both ship in a stock Colab image, so no further entries are required — record that check in the PR so the next reader does not have to redo it.
Weigh the _SAMPLERS split. If taken, move nautilus-sampler, emcee and dynesty into a _SAMPLERS list and build _SHARED_EXTRAS = _NOTEBOOK_EXTRAS + _SAMPLERS (or splice at the _PROJECTS stacks), keeping the installed set byte-identical. The test from step 1 must pass unchanged either way — it asserts on the resolved packages, not on which list a name lives in. If not taken, say why in the PR; the test is the part that carries the value.
test_autonerves/test_setup_colab.py — class TestRegistry (~line 75) is where the new test belongs.
Release note
The fix only reaches users after an autonerves PyPI release: Colab notebooks pip install autonerves fresh on every run.
Original Prompt
Click to expand starting prompt
Regression-test the Colab sampler install (code fix shipped in PyAutoNerves#164)
Type: test
Target: PyAutoNerves
Repos:
PyAutoNerves
Difficulty: trivial
Autonomy: safe
Priority: normal
Status: formalised
Consequence: notify
Witness: a regression test in PyAutoNerves asserting that every entry of _PROJECTS resolves to a packages list containing dynesty and emcee alongside nautilus-sampler — i.e. that all three samplers PyAutoFit exposes as af.DynestyStatic, af.Emcee and af.Nautilus are installed by the Colab bootstrap.
Review-minutes: 10
Unattended: ready
Filed: 2026-09-14
The code fix already shipped — this is the missing test
This prompt was filed 2026-09-14 from review feedback on HowToFit chapter 1
tutorials 4/5/6. The code half was fixed independently the same day in #164 (merged), which added emcee>=3.1.6 and dynesty==2.1.5 to _SHARED_EXTRAS with the specifiers autofit declares, plus
a comment recording why a --no-deps install has to name its siblings' real
dependencies. See complete/2026/09/howtofit-tutorials-1-3.md.
What did not ship is the regression test.#164 was verified only against the
existing suite (183 passed), which asserts nothing about the contents of _SHARED_EXTRAS — test_setup_colab.py checks only packages[0] == "autonerves".
Nothing currently stops a future edit dropping a sampler again, which is exactly
how this bug arose.
Remaining work
Add the test the Witness above describes: for every _PROJECTS entry, the
resolved packages list contains dynesty, emcee and nautilus-sampler.
Assert on the sampler names, not exact pins, so a version bump does not
break it.
Consider whether the three samplers belong in their own _SAMPLERS list
rather than inside _SHARED_EXTRAS. A missing sampler is a hard ModuleNotFoundError at fit time, not a degraded experience, so the grouping
arguably should say so. This is a judgement call, not a given — the test in
step 1 is the part that carries the value.
Still true, and worth keeping in view
The install runs with --no-deps, so any real autofit dependency that a
stock Colab image does not ship must be named in the list explicitly or it never
arrives. emcee and dynesty were the two that bit; a broader audit of autofit's dependencies against a stock Colab image would say whether others
are waiting (corner, typing-inspect, gprof2dot, numpydoc, xxhash, astunparse, array_api_compat, optax are all declared and none is named in _SHARED_EXTRAS). That audit is not required by this prompt but is the obvious
next question.
Colab notebooks pip install autonerves fresh on every run, so #164 reaches users
only once a new autonerves is released to PyPI.
Overview
A HowToFit chapter 1 read-through on 2026-09-14 hit
ModuleNotFoundError: No module named 'dynesty'(tutorial 4) and'emcee'(tutorials 5 and 6) on Colab:autonerves/setup_colab.pyinstalled its package list withpip install *packages --no-deps, and neither sampler was named in_SHARED_EXTRAS, so neither could arrive transitively viaautofit. Every Colab notebook across all six_PROJECTSthat runs a Dynesty or Emcee search died at the fit.The code half already shipped the same day in #164 (merged,
8336939), which addedemcee>=3.1.6anddynesty==2.1.5to_SHARED_EXTRASwith the specifiersautofitdeclares, plus a comment recording why a--no-depsinstall has to name its siblings' real dependencies. What did not ship is the regression test. #164 was verified only against the existing suite, which asserts nothing about the contents of_SHARED_EXTRAS—test_setup_colab.pychecks onlyspec["packages"][0] == "autonerves". Nothing currently stops a future edit dropping a sampler again, which is exactly how this bug arose.Note: Colab notebooks
pip install autonervesfresh on every run, so #164 reaches users only once a newautonervesis released to PyPI.Plan
_PROJECTSentry must resolve to apackageslist containingdynesty,emceeandnautilus-sampler— the three samplers PyAutoFit exposes asaf.DynestyStatic,af.Emceeandaf.Nautilus. Assert on sampler names, not exact pins, so a version bump does not break the test.--no-deps, confirm the two newly-named samplers' own runtime requirements are already present in a stock Colab image (dynestyneeds numpy + scipy,emceeneeds numpy) — otherwise they install but still fail at import._SHARED_EXTRASinto their own_SAMPLERSlist: a missing sampler is a hardModuleNotFoundErrorat fit time, not a degraded experience, so the grouping arguably should say so.autofit's declared dependencies against a stock Colab image would say whether others are waiting behind the same--no-depstrap.Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
feature/autonerves-colab-sampler-depsCurrent state (post-#164)
autonerves/setup_colab.py_SHARED_EXTRAS(~line 36) now reads:The install at ~line 277 is still
subprocess.check_call([sys.executable, "-m", "pip", "install", *packages, "--no-deps"]), so the--no-depsconstraint that caused the bug is unchanged and is the thing the test defends.Implementation Steps
test_autonerves/test_setup_colab.py, inclass TestRegistryalongsidetest_all_projects_have_required_fields. For every entry ofsetup_colab._PROJECTS("autofit","autogalaxy","autolens","howtofit","howtogalaxy","howtolens"), assert the resolvedpackageslist containsdynesty,emceeandnautilus-sampler. Match on the requirement name (split each entry on the version specifier —==,>=,<,~=— before comparing) so a pin bump does not break the test, and fail with the project name in the message.--no-depsruntime requirements hold.dynestyneedsnumpy+scipy;emceeneedsnumpy. Both ship in a stock Colab image, so no further entries are required — record that check in the PR so the next reader does not have to redo it._SAMPLERSsplit. If taken, movenautilus-sampler,emceeanddynestyinto a_SAMPLERSlist and build_SHARED_EXTRAS = _NOTEBOOK_EXTRAS + _SAMPLERS(or splice at the_PROJECTSstacks), keeping the installed set byte-identical. The test from step 1 must pass unchanged either way — it asserts on the resolvedpackages, not on which list a name lives in. If not taken, say why in the PR; the test is the part that carries the value.python3 -m pytest test_autonerves -q); it was 183 passed at fix: install emcee and dynesty in the Colab bootstrap #164.Key Files
autonerves/setup_colab.py—_SHARED_EXTRAS(~line 36),_PROJECTSregistry (~line 52), the--no-depsinstall (~line 277).test_autonerves/test_setup_colab.py—class TestRegistry(~line 75) is where the new test belongs.Release note
The fix only reaches users after an
autonervesPyPI release: Colab notebookspip install autonervesfresh on every run.Original Prompt
Click to expand starting prompt
Regression-test the Colab sampler install (code fix shipped in PyAutoNerves#164)
Type: test
Target: PyAutoNerves
Repos:
Difficulty: trivial
Autonomy: safe
Priority: normal
Status: formalised
Consequence: notify
Witness: a regression test in PyAutoNerves asserting that every entry of
_PROJECTSresolves to apackageslist containingdynestyandemceealongsidenautilus-sampler— i.e. that all three samplers PyAutoFit exposes asaf.DynestyStatic,af.Emceeandaf.Nautilusare installed by the Colab bootstrap.Review-minutes: 10
Unattended: ready
Filed: 2026-09-14
The code fix already shipped — this is the missing test
This prompt was filed 2026-09-14 from review feedback on HowToFit chapter 1
tutorials 4/5/6. The code half was fixed independently the same day in
#164 (merged), which added
emcee>=3.1.6anddynesty==2.1.5to_SHARED_EXTRASwith the specifiersautofitdeclares, plusa comment recording why a
--no-depsinstall has to name its siblings' realdependencies. See
complete/2026/09/howtofit-tutorials-1-3.md.What did not ship is the regression test. #164 was verified only against the
existing suite (183 passed), which asserts nothing about the contents of
_SHARED_EXTRAS—test_setup_colab.pychecks onlypackages[0] == "autonerves".Nothing currently stops a future edit dropping a sampler again, which is exactly
how this bug arose.
Remaining work
_PROJECTSentry, theresolved
packageslist containsdynesty,emceeandnautilus-sampler.Assert on the sampler names, not exact pins, so a version bump does not
break it.
_SAMPLERSlistrather than inside
_SHARED_EXTRAS. A missing sampler is a hardModuleNotFoundErrorat fit time, not a degraded experience, so the groupingarguably should say so. This is a judgement call, not a given — the test in
step 1 is the part that carries the value.
Still true, and worth keeping in view
The install runs with
--no-deps, so any realautofitdependency that astock Colab image does not ship must be named in the list explicitly or it never
arrives.
emceeanddynestywere the two that bit; a broader audit ofautofit'sdependenciesagainst a stock Colab image would say whether othersare waiting (
corner,typing-inspect,gprof2dot,numpydoc,xxhash,astunparse,array_api_compat,optaxare all declared and none is named in_SHARED_EXTRAS). That audit is not required by this prompt but is the obviousnext question.
Colab notebooks
pip install autonervesfresh on every run, so #164 reaches usersonly once a new
autonervesis released to PyPI.