Skip to content

Commit

Permalink
Change Representation to Quantity and Unit (not Plain)
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrecco committed May 7, 2022
1 parent 6cf843f commit 8209237
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pint/facets/plain/quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ def __bytes__(self) -> bytes:

def __repr__(self) -> str:
if isinstance(self._magnitude, float):
return f"<PlainQuantity({self._magnitude:.9}, '{self._units}')>"
return f"<Quantity({self._magnitude:.9}, '{self._units}')>"
else:
return f"<PlainQuantity({self._magnitude}, '{self._units}')>"
return f"<Quantity({self._magnitude}, '{self._units}')>"

def __hash__(self) -> int:
self_base = self.to_base_units()
Expand Down
4 changes: 2 additions & 2 deletions pint/facets/plain/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, units: UnitLike) -> None:
self._units = units._units
else:
raise TypeError(
"units must be of type str, PlainUnit or "
"units must be of type str, Unit or "
"UnitsContainer; not {}.".format(type(units))
)

Expand Down Expand Up @@ -77,7 +77,7 @@ def __bytes__(self) -> bytes:
return str(self).encode(locale.getpreferredencoding())

def __repr__(self) -> str:
return "<PlainUnit('{}')>".format(self._units)
return "<Unit('{}')>".format(self._units)

@property
def dimensionless(self) -> bool:
Expand Down

0 comments on commit 8209237

Please sign in to comment.