Skip to content

Commit

Permalink
WIP - address shadowing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Nov 26, 2024
1 parent d3802fd commit 2cac5aa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions xclim/core/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
units.add_context(hydro)


with (files("xclim.data") / "variables.yml").open() as f:
CF_CONVERSIONS = safe_load(f)["conversions"]
with (files("xclim.data") / "variables.yml").open() as variables:
CF_CONVERSIONS = safe_load(variables)["conversions"]
_CONVERSIONS = {}


Expand Down Expand Up @@ -297,13 +297,13 @@ def pint_multiply(
The product DataArray.
"""
a = 1 * units2pint(da) # noqa
_f = a * q.to_base_units()
f = a * q.to_base_units()
if out_units:
_f = _f.to(out_units)
f = f.to(out_units)
else:
_f = _f.to_reduced_units()
out: xr.DataArray = da * _f.magnitude
out = out.assign_attrs(units=pint2cfunits(_f.units))
f = f.to_reduced_units()
out: xr.DataArray = da * f.magnitude
out = out.assign_attrs(units=pint2cfunits(f.units))
return out


Expand Down

0 comments on commit 2cac5aa

Please sign in to comment.