refactor(model_util): replace simulator_start_here_model_from with direct random_galaxies_for_simulation_from#529
Merged
Conversation
…rect random_galaxies_for_simulation_from Mirrors the PyAutoGalaxy change. The old helper built af.Model(lp_snr.Sersic) with signal_to_noise_ratio = UniformPrior(20, 60) for both lens light and source, then callers did .random_instance() to sample. Replace with random_galaxies_for_simulation_from(include_lens_light, use_point_source), which returns (lens_galaxy, source_galaxy) concrete instances sampled via numpy.random.Generator — no af.Model priors involved. Same SNR-is-data rationale as the autogalaxy sibling. Co-Authored-By: Claude Opus 4.7 (1M context) <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
simulator_start_here_model_from(include_lens_light, use_point_source)— it builtaf.Model(al.lp_snr.Sersic)withsignal_to_noise_ratio = af.UniformPriorfor both lens light and source.random_galaxies_for_simulation_from(include_lens_light, use_point_source, rng=None)— returns(lens_galaxy, source_galaxy)concreteal.Galaxyinstances sampled vianumpy.random.Generator. Noaf.Modelpriors anywhere.SIMULATOR_RANDOM_LENS_SUMMARYas a one-line replacement for the verbose model.info prints in start_here scripts.Test plan
pytest test_autolens/ -x -q— 294 passedsignal_to_noise_ratio.*Priorreturns zero hits acrossautolens/python -c "import autolens as al; assert not hasattr(al.model_util, 'simulator_start_here_model_from')"passesCoordinated PRs
feature/fix-snr-model-smell-and-ci(sibling change forag.model_util)feature/fix-snr-model-smell-and-ci(callers + nufftax CI fix)🤖 Generated with Claude Code