You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some questions about this though. galsim.Image are mutable objects, which really does not play nicely with JAX, it is simply not possible to assign values to array in jax without making a copy. We can follow the galsim API, but the behavior will be different, it won't be possible to assign values to a view of a larger image.
In particular, we cannot do the following in Jax-GalSim:
gal = galsim.Gaussian(sigma=1)
im = galsim.Image(nx=128, ny=128, scale=0.1)
imview = im.view()
gal.drawImage(imview)
This would not update the original im.
This will become even sharper of a question when we go to the next PR, which implements drawing functions.
Already here, there is a question of whether we want to make all Image immutable explicitly, whether we want to allow this sort of things:
these are examples of bad OO patterns that do not play nicely at all with the JAX functional spirit, but if we remove them, we break the GalSim API....
The text was updated successfully, but these errors were encountered:
A couple of methods in the Image class still modify the object, perhaps we should change them so that they return a new object to be more in the JAX spirit?
Reposted from #16 from @EiffL
The text was updated successfully, but these errors were encountered: