Skip to content

Commit 86f9fdf

Browse files
committed
fix import with astropy>4.3
astropy/astropy#11975
1 parent 651c428 commit 86f9fdf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎radis/phys/units_astropy.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ def convert_and_strip_units(quantity, output_unit=None, digit=10):
4747
import astropy.units as u
4848

4949
if isinstance(quantity, u.Quantity):
50+
from astropy.units.imperial import deg_F
51+
5052
# TODO : make it possible to test if not adimensionned, before loading.
5153
# This would allow not to have to load Astropy.units on start-up?
52-
if output_unit in (u.deg_C, u.imperial.deg_F, u.K):
54+
if output_unit in (u.deg_C, deg_F, u.K):
5355
quantity = quantity.to_value(output_unit, equivalencies=u.temperature())
5456
elif isinstance(output_unit, (u.UnitBase, u.Quantity)):
5557
quantity = quantity.to_value(output_unit, equivalencies=u.spectral())

0 commit comments

Comments
 (0)