File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -313,9 +313,15 @@ def find_matching_pint_definitions(report_file: Path | None = None) -> None:
313
313
lookup_str = MAPPINGS_UCUM_TO_PINT .get (ucum_code , ucum_code )
314
314
if is_in_registry (transformer_default , parsed_data ):
315
315
if section == "prefixes" :
316
- pint_prefix = str (ureg_default (f"{ ucum_code } m" ).units ).removesuffix (
317
- "meter"
318
- )
316
+ # Python 3.9+:
317
+ # pint_prefix = str(ureg_default(f"{ucum_code}m").units).removesuffix(
318
+ # "meter"
319
+ # )
320
+ # TODO replace next 3 lines by code above when 3.8 is no longer supported.
321
+ pint_prefix = str (ureg_default (f"{ ucum_code } m" ).units )
322
+ if pint_prefix .endswith ("meter" ):
323
+ pint_prefix = pint_prefix [: - len (pint_prefix )]
324
+
319
325
report .append (
320
326
f"# { lookup_str :>10} --> { pint_prefix } (default registry)"
321
327
)
You can’t perform that action at this time.
0 commit comments