Skip to content

Commit

Permalink
fix: cfunits->cf-units
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbjoernl committed Jan 17, 2025
1 parent 0207dc7 commit 97bb7fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pyaro_readers/harpreader/harpreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_HARPReader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import pyaro
import pyaro.timeseries
import cfunits
import cf_units
import os


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 97bb7fd

Please sign in to comment.