Skip to content

refactor(model_util): replace simulator_start_here_model_from with direct random_galaxies_for_simulation_from#529

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/fix-snr-model-smell-and-ci
May 22, 2026
Merged

refactor(model_util): replace simulator_start_here_model_from with direct random_galaxies_for_simulation_from#529
Jammy2211 merged 1 commit into
mainfrom
feature/fix-snr-model-smell-and-ci

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

  • Remove simulator_start_here_model_from(include_lens_light, use_point_source) — it built af.Model(al.lp_snr.Sersic) with signal_to_noise_ratio = af.UniformPrior for both lens light and source.
  • Replace with random_galaxies_for_simulation_from(include_lens_light, use_point_source, rng=None) — returns (lens_galaxy, source_galaxy) concrete al.Galaxy instances sampled via numpy.random.Generator. No af.Model priors anywhere.
  • Export SIMULATOR_RANDOM_LENS_SUMMARY as a one-line replacement for the verbose model.info prints in start_here scripts.

Test plan

  • pytest test_autolens/ -x -q — 294 passed
  • Structural grep: signal_to_noise_ratio.*Prior returns zero hits across autolens/
  • python -c "import autolens as al; assert not hasattr(al.model_util, 'simulator_start_here_model_from')" passes

Coordinated PRs

  • PyAutoGalaxy — feature/fix-snr-model-smell-and-ci (sibling change for ag.model_util)
  • autogalaxy_workspace + autolens_workspace — feature/fix-snr-model-smell-and-ci (callers + nufftax CI fix)

🤖 Generated with Claude Code

…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>
@Jammy2211 Jammy2211 merged commit 4a3ccf6 into main May 22, 2026
6 checks passed
@Jammy2211 Jammy2211 deleted the feature/fix-snr-model-smell-and-ci branch May 22, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant