feat: SimulatorImaging.via_galaxies_from auto-default xp from parent use_jax#442
Merged
Merged
Conversation
… use_jax Changes via_galaxies_from to accept xp=None and fall back to self._xp inherited from aa.SimulatorImaging. When the simulator is constructed with use_jax=True, via_galaxies_from now routes xp=jnp through galaxies.padded_image_2d_from and via_image_from without the user passing xp explicitly. Depends on Jammy2211/PyAutoArray PR adding the use_jax constructor flag + _xp property to the parent aa.SimulatorImaging. Part of Phase 2 PR 2 of z_features/jax_user_intro.md. Issue: PyAutoArray#334 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
Companion PR to the PyAutoArray PR adding
use_jax=Truetoaa.SimulatorImaging. The autogalaxyvia_galaxies_fromoverride gains anxp=Noneparameter and defaults toself._xpfrom the parent — same pattern as the PyAutoLensvia_tracer_fromcompanion.After all 3 PRs merge:
API Changes
ag.SimulatorImaging.via_galaxies_from(galaxies, grid, xp=None)—xpnow defaults toNone. New behaviour: falls back toself._xp(inherited fromaa.SimulatorImaging).See full details below.
Test Plan
autolens_workspace_testparity script, bundled in the workspace_test follow-up).Full API Changes
Changed signature
ag.SimulatorImaging.via_galaxies_from(galaxies, grid, xp=None)— gainedxpparameter (previously not accepted). New behaviour:xp=Nonefalls back toself._xp.Migration
xp=continue to work.Depends on
use_jaxtoaa.SimulatorImaging. Merge PyAutoArray first.🤖 Generated with Claude Code