Closed turmon closed 2 months ago
Fix steps: 1) Remove our own version of Box1D (after verifying that current synphot provided Box1D works the same way) 2) Remove all associated imports 3) Set synphot minimum version to 1.3 and astropy minimum version to 5.0
Closed by #377
Describe the bug Import of photometricModels.py (from, e.g., Nemati.py) fails with astropy 6.0+ / synphot 1.4+
To Reproduce
The stack trace below summarizes the issue. It's on astropy 6.0.1, synphot 1.4.0, but I assume any astropy >= 6 will do.
The import line that causes the exception is verbatim from the OpticalSystem prototype.
Expected behavior A successful import.
JSON script: Not needed, see above
EXOSIMS version: current master (3.2.0)
Additional context I believe
ASTROPY_LT_5_0
is a compatibility variable to help with the astropy 4-to-5 transition, and it's no longer present in astropy 6.0+ / synphot 1.4+ (verified by inspecting changes in the synphot/compat.py source).The
photometricModels.py
code is testing this variable to use the right method when it makes a box object.The fix I used is to trap the import exception and to define ASTROPY_LT_5_0 = False if it occurs:
Another fix would be to just assume astropy >= 5.0, and remove the
if
within the box construction entirely.