Skip to content

Commit

Permalink
In _parse_units make as_delta and case_sensitive mandatory and pure b…
Browse files Browse the repository at this point in the history
…oolean. Also make external uses of _parse_units to parse_units
  • Loading branch information
hgrecco committed Jul 15, 2023
1 parent f23e451 commit 7979d07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pint/facets/plain/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,8 @@ def parse_units(
def _parse_units(
self,
input_string: str,
as_delta: bool = True,
case_sensitive: Optional[bool] = None,
as_delta: bool,
case_sensitive: bool,
) -> UnitsContainer:
"""Parse a units expression and returns a UnitContainer with
the canonical names.
Expand Down
3 changes: 1 addition & 2 deletions pint/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,7 @@ def to_units_container(
return unit_like._units
elif str in mro:
if registry:
# TODO: Why not parse.units here?
return registry._parse_units(unit_like)
return registry.parse_units(unit_like)
else:
return ParserHelper.from_string(unit_like)
elif dict in mro:
Expand Down

0 comments on commit 7979d07

Please sign in to comment.