diff --git a/src/pyaro_readers/harpreader/harpreader.py b/src/pyaro_readers/harpreader/harpreader.py index 8fe4897..7908d9e 100644 --- a/src/pyaro_readers/harpreader/harpreader.py +++ b/src/pyaro_readers/harpreader/harpreader.py @@ -13,7 +13,7 @@ import numpy as np from pathlib import Path from tqdm import tqdm -import cfunits +import cf_units from pyaro_readers.units_helpers import UALIASES import datetime @@ -133,7 +133,7 @@ def _read_file_variables(self, filename) -> dict[str, str]: # Units in pyaro arte by definition strings, but this way # we can make sure that cfunits understands them # otherwise variables[vname] = var.attrs["units"] should work as well - variables[vname] = str(cfunits.Units(var.attrs["units"])) + variables[vname] = str(cf_units.Unit(var.attrs["units"])) if variables[vname] in UALIASES: variables[vname] = UALIASES[variables[vname]] diff --git a/tests/test_HARPReader.py b/tests/test_HARPReader.py index 2820d62..75bd65f 100644 --- a/tests/test_HARPReader.py +++ b/tests/test_HARPReader.py @@ -1,7 +1,7 @@ import unittest import pyaro import pyaro.timeseries -import cfunits +import cf_units import os @@ -31,7 +31,7 @@ def test_1read(self): self.assertGreater(len(data), 10000) assert isinstance(data.units, str) self.assertEqual( - data.units, str(cfunits.Units(self.test_units[_v_idx])) + data.units, str(cf_units.Unit(self.test_units[_v_idx])) ) self.assertGreaterEqual(len(ts.variables()), 2) self.assertGreaterEqual(len(ts.stations()), 1)