Skip to content

Commit

Permalink
Rename _IrisUnit to Unit.
Browse files Browse the repository at this point in the history
  • Loading branch information
trexfeathers committed Dec 17, 2024
1 parent 6c1ab16 commit 80298dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/iris/common/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ def update(self, other, **kwargs):
dict.update(self, other, **kwargs)


class _IrisUnit(cf_units.Unit):
class Unit(cf_units.Unit):
# TODO: remove this subclass once FUTURE.date_microseconds is removed.

@classmethod
def from_unit(cls, unit: cf_units.Unit):
"""Cast a :class:`cf_units.Unit` to an :class:`_IrisUnit`."""
if isinstance(unit, _IrisUnit):
"""Cast a :class:`cf_units.Unit` to an :class:`Unit`."""
if isinstance(unit, Unit):
result = unit
elif isinstance(unit, cf_units.Unit):
result = cls.__new__(cls)
Expand Down Expand Up @@ -272,7 +272,7 @@ def units(self) -> cf_units.Unit:
@units.setter
def units(self, unit: cf_units.Unit | str | None) -> None:
unit = cf_units.as_unit(unit)
self._metadata_manager.units = _IrisUnit.from_unit(unit)
self._metadata_manager.units = Unit.from_unit(unit)

@property
def attributes(self) -> LimitedAttributeDict:
Expand Down

0 comments on commit 80298dd

Please sign in to comment.