Skip to content

Commit

Permalink
test: clean up more test stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Aug 22, 2024
1 parent 79536e1 commit a2f674a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions tests/test_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def test_photon_array_depr():
photon_array.dxdz = 0.17
else:
dxdz = photon_array.dxdz # Allowed now.
dxdz[:] = 0.17
dxdz[:] = 0.17
np.testing.assert_array_equal(photon_array.dxdz, 0.17)

if is_jax_galsim():
Expand All @@ -687,15 +687,22 @@ def test_photon_array_depr():
assert photon_array.hasAllocatedPupil()
assert len(photon_array.pupil_u) == nphotons
assert len(photon_array.pupil_v) == nphotons
# JAX-Galsim does not allow by reference setting - changed this
# to make tests below run
photon_array.pupil_v = 10.0
if is_jax_galsim():
# JAX-Galsim does not allow by reference setting - changed this
# to make tests below run
photon_array.pupil_v = 10.0
else:
v[:] = 10.0
np.testing.assert_array_equal(photon_array.pupil_u, 0.0)
np.testing.assert_array_equal(photon_array.pupil_v, 10.0)
assert hasattr(photon_array, "pupil_u")
# JAX-Galsim does not allow by reference setting - changed this
# to make tests below run
photon_array.pupil_u = 6.0
if is_jax_galsim():
assert hasattr(photon_array, "pupil_u")
# JAX-Galsim does not allow by reference setting - changed this
# to make tests below run
photon_array.pupil_u = 6.0
else:
u = photon_array.pupil_u
u[:] = 6.0
np.testing.assert_array_equal(photon_array.pupil_u, 6.0)

# Check assignAt
Expand Down

0 comments on commit a2f674a

Please sign in to comment.