Skip to content

Commit

Permalink
Fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
jules-ch committed Sep 3, 2022
1 parent 7f1cfcf commit b437377
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pint/facets/context/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def context(self, *names, **kwargs) -> ContextManager[Context]:
--------
Context can be called by their name:
import pint.facets.context.objects
>>> import pint.facets.context.objects
>>> import pint
>>> ureg = pint.UnitRegistry()
>>> ureg.add_context(pint.facets.context.objects.Context('one'))
Expand Down
4 changes: 2 additions & 2 deletions pint/facets/plain/quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,9 @@ def to_compact(self, unit=None) -> PlainQuantity[_MagnitudeType]:
>>> import pint
>>> ureg = pint.UnitRegistry()
>>> (200e-9*ureg.s).to_compact()
<PlainQuantity(200.0, 'nanosecond')>
<Quantity(200.0, 'nanosecond')>
>>> (1e-2*ureg('kg m/s^2')).to_compact('N')
<PlainQuantity(10.0, 'millinewton')>
<Quantity(10.0, 'millinewton')>
"""

if not isinstance(self.magnitude, numbers.Number):
Expand Down

0 comments on commit b437377

Please sign in to comment.