Conversation
beckermr
reviewed
Feb 6, 2026
examples/demo1.py
Outdated
| import os | ||
| import math | ||
| import logging | ||
| import jax_galsim as galsim |
Collaborator
There was a problem hiding this comment.
I wonder if we do ourselves a disservice by making this a pattern we promote.
Collaborator
Author
There was a problem hiding this comment.
I agree with your concern and think using import jax_galsim directly is clearer, so I've switched to this. Let me know if that works for you.
beckermr
requested changes
Feb 6, 2026
Collaborator
beckermr
left a comment
There was a problem hiding this comment.
I want to think carefully about emulating the C++ objects by returning pure galsim objects. It works for this case, but that as an API is odd to me. I don't think we'd do this everywhere.
Merging this PR will degrade performance by 38.28%
Performance Changes
Comparing |
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.
This PR adds a new HSM module that calls the standard GalSim implementation. The code is almost identical to
hsm.pyfrom GalSim, with minimal adaptations to accept JAX-GalSim objects as inputs.I also added
Image,Bounds, andPositionmethods that return the underlying GalSim C++ objects, which are required for calls into the_galsimC++ layer.In addition, this PR introduces
demo1.pyanddemo2.py, which are direct copies of the corresponding GalSim demos, modified only to importjax_galsim.The logs produced by GalSim and JAX-GalSim differ slightly. This may be related to differences in how images are drawn in JAX-GalSim rather than the HSM computation itself. I’d be curious to hear your thoughts on this @beckermr.
demo1.pyGalSim
JAX-GalSim
demo2.pyGalSim
JAX-GalSim