Skip to content

Commit 0d16a3e

Browse files
committed
black and minor
1 parent 65b3d4d commit 0d16a3e

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

gsw_xarray/tests/test_units.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
"""
2-
Testing units with pint and UDUNITS2
2+
Testing units with pint
33
"""
44
import pytest
55

66
from .test_imports import gsw_base
77
from gsw_xarray._attributes import _func_attrs
88

99
from pint import UnitRegistry
10+
1011
ureg = UnitRegistry()
1112

13+
1214
@pytest.mark.parametrize("func_name", gsw_base)
1315
def test_unit_pint(func_name):
1416
if func_name in ["indexer", "match_args_return", "pchip_interp"]:
1517
# Internal gsw cookery or non wrapped functions
1618
return
17-
if func_name == 'geostrophic_velocity':
18-
pytest.xfail('geostrophic_velocity outputs "degree_north" and "degree_east" that are not compatible with pint')
19+
if func_name == "geostrophic_velocity":
20+
pytest.xfail(
21+
'geostrophic_velocity outputs "degree_north" and "degree_east" that are not compatible with pint'
22+
)
1923
attrs = _func_attrs[func_name]
2024
if isinstance(attrs, dict):
21-
attrs = [attrs,]
25+
attrs = [
26+
attrs,
27+
]
2228
for a in attrs:
23-
print(a['units'])
24-
ureg.Unit(a['units'])
29+
print(a["units"])
30+
ureg.Unit(a["units"])

poetry.lock

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ furo = {version = ">=2022.1.2", optional = true}
1414

1515
[tool.poetry.dev-dependencies]
1616
pytest = ">=6.2.5"
17+
Pint = ">=0.18"
1718

1819
[tool.poetry.extras]
1920
docs = ["Sphinx", "furo"]

0 commit comments

Comments
 (0)