Skip to content

Commit 7e8e0d2

Browse files
authored
Rename package (#15)
* rename the main package to pint_xarray just like it was recently done for pint_pandas * also rename the package in the isort configuration
1 parent 3066aa4 commit 7e8e0d2

File tree

6 files changed

+10
-19
lines changed

6 files changed

+10
-19
lines changed
File renamed without changes.

pintxarray/accessors.py renamed to pint_xarray/accessors.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
# TODO is it possible to import pint-xarray from within xarray if pint is present?
2+
import numpy as np
3+
import pint
4+
from pint.quantity import Quantity
5+
from pint.unit import Unit
26
from xarray import (
3-
register_dataarray_accessor,
4-
register_dataset_accessor,
57
DataArray,
68
Dataset,
79
Variable,
10+
register_dataarray_accessor,
11+
register_dataset_accessor,
812
)
913
from xarray.core.npcompat import IS_NEP18_ACTIVE
1014

11-
import numpy as np
12-
13-
import pint
14-
from pint.quantity import Quantity
15-
from pint.unit import Unit
16-
17-
1815
if not hasattr(Quantity, "__array_function__"):
1916
raise ImportError(
2017
"Imported version of pint does not implement " "__array_function__"
File renamed without changes.

pintxarray/tests/test_accessors.py renamed to pint_xarray/tests/test_accessors.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1+
import numpy as np
12
import pytest
2-
33
import xarray as xr
4-
from xarray.testing import assert_equal
5-
6-
import numpy as np
74
from numpy.testing import assert_array_equal
8-
95
from pint import UnitRegistry
106

117
# from pint.unit import Unit
128
from pint.errors import UndefinedUnitError # , DimensionalityError
9+
from xarray.testing import assert_equal
1310

1411
# from pintxarray.accessors import PintDataArrayAccessor, PintDatasetAccessor
1512
from .utils import raises_regex # extract_units
1613

17-
1814
# make sure scalars are converted to 0d arrays so quantities can
1915
# always be treated like ndarrays
2016
unit_registry = UnitRegistry(force_ndarray=True)

pintxarray/tests/utils.py renamed to pint_xarray/tests/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
from contextlib import contextmanager
21
import re
2+
from contextlib import contextmanager
33

44
import pytest
5-
65
import xarray as xr
7-
86
from pint.quantity import Quantity
97

108

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exclude=
3030

3131
[isort]
3232
default_section = THIRDPARTY
33-
known_first_party = pintxarray
33+
known_first_party = pint_xarray
3434
multi_line_output = 3
3535
include_trailing_comma = True
3636
force_grid_wrap = 0

0 commit comments

Comments
 (0)