Skip to content

Commit

Permalink
add arg
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgsavage committed Jun 27, 2024
1 parent 496df90 commit a0f7a71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions pint/delegates/formatter/_compound_unit_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def prepare_compount_unit(
locale: Locale | str | None = None,
as_ratio: bool = True,
registry: UnitRegistry | None = None,
empty_numerator_fmt="1",
) -> tuple[Iterable[tuple[str, T]], Iterable[tuple[str, T]]]:
"""Format compound unit into unit container given
an spec and locale.
Expand Down
12 changes: 4 additions & 8 deletions pint/delegates/formatter/plain.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def format_unit(
unit: PlainUnit | Iterable[tuple[str, Any]],
uspec: str = "",
sort_func: SortFunc | None = None,
empty_numerator_fmt = "1",
empty_numerator_fmt="1",
**babel_kwds: Unpack[BabelKwds],
) -> str:
"""Format a unit (can be compound) into string
Expand Down Expand Up @@ -204,7 +204,7 @@ def format_unit(
unit: PlainUnit | Iterable[tuple[str, Any]],
uspec: str = "",
sort_func: SortFunc | None = None,
empty_numerator_fmt = "1",
empty_numerator_fmt="1",
**babel_kwds: Unpack[BabelKwds],
) -> str:
numerator, denominator = prepare_compount_unit(
Expand Down Expand Up @@ -316,16 +316,13 @@ def format_unit(
unit: PlainUnit | Iterable[tuple[str, Any]],
uspec: str = "",
sort_func: SortFunc | None = None,
empty_numerator_fmt="1",

empty_numerator_fmt="1",
**babel_kwds: Unpack[BabelKwds],

) -> str:
numerator, denominator = prepare_compount_unit(
unit,
uspec,
sort_func=sort_func,

**babel_kwds,
registry=self._registry,
)
Expand All @@ -346,8 +343,7 @@ def format_unit(
power_fmt="{}{}",
parentheses_fmt="({})",
exp_call=pretty_fmt_exponent,
empty_numerator_fmt=empty_numerator_fmt,

empty_numerator_fmt=empty_numerator_fmt,
)

def format_quantity(
Expand Down

0 comments on commit a0f7a71

Please sign in to comment.