From 9a06b53097cdf9157eca63cd1c014c8d08743ce4 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Wed, 28 Jun 2023 15:15:33 +0100 Subject: [PATCH] Use alias for unit_registry --- xarray/tests/test_units.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xarray/tests/test_units.py b/xarray/tests/test_units.py index 1440d6924f5..dda89a28f61 100644 --- a/xarray/tests/test_units.py +++ b/xarray/tests/test_units.py @@ -75,13 +75,15 @@ def assert_equal(q1, q2): class PintInfo(UnitInfo): - unit = unit_registry.m - compatible_unit = unit_registry.mm - incompatible_unit = unit_registry.s - dimensionless = unit_registry.dimensionless + ureg = unit_registry + + unit = ureg.m + compatible_unit = ureg.mm + incompatible_unit = ureg.s + dimensionless = ureg.dimensionless - unit_type = unit_registry.Unit - quantity_type = unit_registry.Quantity + unit_type = ureg.Unit + quantity_type = ureg.Quantity @staticmethod def strip_units(quantity):