Closed bwinkel closed 4 years ago
With astropy v4 constants can have versions. For backwards compatibility reasons, pycraf uses astropy v2.x values, i.e.
pycraf
astropy
import astropy astropy.physical_constants.set('astropyconst20') astropy.astronomical_constants.set('astropyconst20')
One issue with this is that astropy.units must be imported afterwards, otherwise
astropy.units
import astropy.units as u import astropy astropy.physical_constants.set('astropyconst20') >>> RuntimeError: astropy.units is already imported
likewise for pycraf:
import astropy.units as u import pycraf >>> RuntimeError: astropy.units is already imported
Unfortunately, for end uses it may not be obvious, what is happening, so it'd be good to add some information to the exception.
With astropy v4 constants can have versions. For backwards compatibility reasons,
pycraf
usesastropy
v2.x values, i.e.One issue with this is that
astropy.units
must be imported afterwards, otherwiselikewise for pycraf:
Unfortunately, for end uses it may not be obvious, what is happening, so it'd be good to add some information to the exception.