spacetelescope / webbpsf

James Webb Space Telescope PSF simulation tool
https://webbpsf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
119 stars 63 forks source link

switch a test case float comparison to np.allclose for robustness #934

Closed mperrin closed 2 days ago

mperrin commented 2 days ago

Minor test case fix. Found a case where it was doing a precise == comparison on two floats, which led to intermittent sometimes-failing and sometimes-working due to floating point precision issues. I switched it to use np.isclose() which will apply appropriate tolerances for a floating point comparison.