Repository navigation
fix(config): prior yaml drift — stale classes, paths, params + walker test - #619
Merged
Merged
Conversation
… test
`autonerves.JSONPriorConfig` resolves a prior by asking whether
`{cls.__module__}.{cls.__name__}.{param}` ends with the dotted path of a
yaml under `config/priors/` plus its key, so a yaml at the wrong path, a
typo'd class key or a param the class no longer takes is silently dead
rather than an error. Fix every such row in the packaged config:
- light/operated/sersic.yaml: `ersic` -> `Sersic` (operated Sersic priors
were dead and fell back to the standard Sersic file)
- mass/dark: move `NFWTruncatedMCRScatterLudlowSph` from
nfw_truncated_mcr.yaml to nfw_truncated_mcr_scatter.yaml, matching its
module; `af.Model(NFWTruncatedMCRScatterLudlowSph)` raised ConfigException
- light/linear/chameleon.yaml, eff.yaml: delete — no linear Chameleon or
ElsonFreeFall class exists
- point_sources.yaml: drop `PointSourceChi` (class removed)
- mass/stellar/sersic_core.yaml: drop `SersicCoreSph.mass_to_light_ratio`
(not an __init__ argument)
- light/linear_operated/gaussian.yaml: drop `Gaussian.intensity` (linear
profiles have no intensity)
- ellipse/ellipse_multipole.yaml: `EllipseMultipoleRelative` ->
`EllipseMultipoleScaled`, `gaussian_limits` -> `limits`
- mesh/delaunay.yaml: drop the empty `DelaunayNN` key (module is
delaunay_nn); mesh/README.md no longer mentions the removed Voronoi mesh
Add test_autogalaxy/test_priors_config.py: walks the packaged priors and
asserts every top-level key suffix-matches a real PyAuto class and every
param is an __init__ argument, plus model-construction regressions for
NFWTruncatedMCRScatterLudlowSph and EllipseMultipoleScaled. All four new
assertions fail on the unfixed config.
Refs #618 (stays open for the workspace follow-up PRs)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 16, 2026
Collaborator
Author
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
autonerves.JSONPriorConfiglooks a prior up by testing whether{cls.__module__}.{cls.__name__}.{param}ends with the dotted path of a yaml underconfig/priors/plus its key. A yaml at the wrong path, a typo'd class key or a param the class does not take is therefore silently dead — the MRO walk finds a parent's file and nothing errors. The euclid pipeline's config-drift sweep (euclid#43 / PR #44) found rows that reproduce identically in the packagedautogalaxy/config/priors/; one is a live failure (af.Model(ag.mp.NFWTruncatedMCRScatterLudlowSph)raisesConfigException).This PR fixes every dead row in the packaged config and adds a walker test so the class of bug cannot recur. Refs #618 — the issue stays open until the workspace re-sync PRs merge.
config/priors/)light/operated/sersic.yamlersic(typo)Sersicmass/dark/nfw_truncated_mcr.yamlNFWTruncatedMCRScatterLudlowSphblock under the wrong module's file →ConfigExceptionmass/dark/nfw_truncated_mcr_scatter.yamllight/linear/chameleon.yaml,light/linear/eff.yamllp_linear.Chameleon/ElsonFreeFallpoint_sources.yamlPointSourceChiblock, class removedmass/stellar/sersic_core.yamlSersicCoreSph.mass_to_light_ratio, not an__init__arglight/linear_operated/gaussian.yamlGaussian.intensity, linear profiles have no intensityellipse/ellipse_multipole.yamlEllipseMultipoleRelative(class isEllipseMultipoleScaled),gaussian_limits(key islimits)mesh/delaunay.yamlDelaunayNNkey underdelaunay(module isdelaunay_nn)mesh/README.mdThe
ellipse_multipole.yamlanddelaunay.yamlrows were not in the issue's table — the new walker test found them.cosmology.yaml::model.FlatLambdaCDMwas re-verified as not drift (the dotted key is the correct suffix and resolves) and is untouched.Behaviour change for users: the operated
SersicandEllipseMultipoleScaledpriors now actually load from their own yaml files instead of falling back to the parent class's. Diffinglight/operated/sersic.yamlagainstlight/standard/sersic.yaml: the operated file carries all seven parameters with the same values, exceptell_comps_0/1, which areTruncatedGaussian(mean 0, sigma 0.3, bounds -1..1) rather thanGaussianwithlimits-1..1 — the type ten other packaged prior files already use. So the only prior that changes for an operatedSersicmodel is the ellipticity prior type.API Changes
None — packaged configuration and tests only. No Python source changes.
Test Plan
test_autogalaxy/test_priors_config.py—test__every_prior_key_resolves_to_a_classandtest__every_prior_parameter_is_an_init_argumentwalkautogalaxy/config/priors/**against a class census ofautogalaxy,autoarray,autofit;test__nfw_truncated_mcr_scatter_ludlow_sph_model_resolvesandtest__ellipse_multipole_scaled_model_resolvesconstruct the previously unresolvable models. All four fail on the unfixed config (red witness run on this branch with only the yaml stashed) and pass with the fix.pytest test_autogalaxypasses in the task worktree.lib-tests.yml) green.config/copies in autolens_workspace, autogalaxy_workspace, HowToLens and autolens_workspace_test (plus their staleplots_search.yaml/ readerlessgeneral.yaml::fits.flip_for_ds9) — tracked on fix(config): prior yaml drift — stale classes, paths, params + walker test #618.Heart at ship time:
stale— "release validation incomplete: no rehearsal for current source" (freshness tier, nothing known-bad; organism-scope, not branch-scope).Full API Changes (for automation & release notes)
Changed Behaviour
autogalaxy.profiles.light.operated.Sersicnow load fromconfig/priors/light/operated/sersic.yaml(previously dead keyersic; the standardSersicfile was used instead).autogalaxy.EllipseMultipoleScalednow load fromconfig/priors/ellipse/ellipse_multipole.yaml(previously dead keyEllipseMultipoleRelative).af.Model(autogalaxy.mp.NFWTruncatedMCRScatterLudlowSph)now constructs; previously raisedConfigExceptionbecause its priors lived undernfw_truncated_mcr.yaml.Removed (dead configuration only, no Python symbols)
config/priors/light/linear/chameleon.yaml,config/priors/light/linear/eff.yamlconfig/priors/point_sources.yaml::PointSourceChiconfig/priors/mass/stellar/sersic_core.yaml::SersicCoreSph.mass_to_light_ratioconfig/priors/light/linear_operated/gaussian.yaml::Gaussian.intensityconfig/priors/mesh/delaunay.yaml::DelaunayNNAdded
config/priors/mass/dark/nfw_truncated_mcr_scatter.yamltest_autogalaxy/test_priors_config.pyMigration
config/priors/copies should apply the same edits (follow-up PRs).Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code