You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may not qualify as an issue, but perhaps just a note for the future. In which case, feel free to close.
Adding the Hubble constant, little h, to a UnitRegistry produces some unintended behavior when converting to astropy and back from astropy. This seems to be because "h" in astropy.units is already defined to mean hour. I bring this up because using little h as the Hubble constant is now quite common in yt and other places with cosmological datasets.
What I Did
from unyt import UnitRegistry, unyt_quantity
from unyt.dimensions import dimensionless
ur = UnitRegistry()
ur.add('h', 0.7, dimensionless)
L = unyt_quantity(1, 'Mpc/h', registry=ur)
L2 = L.from_astropy(L.to_astropy())
print (L)
print (L2)
This gives:
1 Mpc/h
1.0 Mpc/hr
Maybe there is nothing that can be done about this, but I thought I'd make it known in case it wasn't previously.
The text was updated successfully, but these errors were encountered:
Description
This may not qualify as an issue, but perhaps just a note for the future. In which case, feel free to close.
Adding the Hubble constant, little h, to a UnitRegistry produces some unintended behavior when converting to astropy and back from astropy. This seems to be because "h" in astropy.units is already defined to mean hour. I bring this up because using little h as the Hubble constant is now quite common in yt and other places with cosmological datasets.
What I Did
This gives:
Maybe there is nothing that can be done about this, but I thought I'd make it known in case it wasn't previously.
The text was updated successfully, but these errors were encountered: