diff --git a/src/pint/phase.py b/src/pint/phase.py index 0c87fe215..1f7893b54 100644 --- a/src/pint/phase.py +++ b/src/pint/phase.py @@ -8,8 +8,6 @@ from astropy.time.utils import two_sum, two_product from astropy.utils import minversion -from pint import dimensionless_cycles - __all__ = ['Phase', 'FractionalPhase'] @@ -22,6 +20,9 @@ np.less, np.less_equal, np.greater, np.greater_equal} +dimensionless_cycles = [(u.cycle, None)] + + def day_frac(val1, val2, factor=None, divisor=None): """Return the sum of ``val1`` and ``val2`` as two float64s. @@ -170,6 +171,9 @@ def __new__(cls, angle, unit=None, wrap_angle=None, **kwargs): if isinstance(angle, Phase): angle = angle['frac'] + if unit is None: + unit = cls._default_unit + with u.add_enabled_equivalencies(dimensionless_cycles): return super().__new__(cls, angle, unit=unit, wrap_angle=wrap_angle, **kwargs)