File tree Expand file tree Collapse file tree 6 files changed +10
-19
lines changed Expand file tree Collapse file tree 6 files changed +10
-19
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1
1
# 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
2
6
from xarray import (
3
- register_dataarray_accessor ,
4
- register_dataset_accessor ,
5
7
DataArray ,
6
8
Dataset ,
7
9
Variable ,
10
+ register_dataarray_accessor ,
11
+ register_dataset_accessor ,
8
12
)
9
13
from xarray .core .npcompat import IS_NEP18_ACTIVE
10
14
11
- import numpy as np
12
-
13
- import pint
14
- from pint .quantity import Quantity
15
- from pint .unit import Unit
16
-
17
-
18
15
if not hasattr (Quantity , "__array_function__" ):
19
16
raise ImportError (
20
17
"Imported version of pint does not implement " "__array_function__"
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ import numpy as np
1
2
import pytest
2
-
3
3
import xarray as xr
4
- from xarray .testing import assert_equal
5
-
6
- import numpy as np
7
4
from numpy .testing import assert_array_equal
8
-
9
5
from pint import UnitRegistry
10
6
11
7
# from pint.unit import Unit
12
8
from pint .errors import UndefinedUnitError # , DimensionalityError
9
+ from xarray .testing import assert_equal
13
10
14
11
# from pintxarray.accessors import PintDataArrayAccessor, PintDatasetAccessor
15
12
from .utils import raises_regex # extract_units
16
13
17
-
18
14
# make sure scalars are converted to 0d arrays so quantities can
19
15
# always be treated like ndarrays
20
16
unit_registry = UnitRegistry (force_ndarray = True )
Original file line number Diff line number Diff line change 1
- from contextlib import contextmanager
2
1
import re
2
+ from contextlib import contextmanager
3
3
4
4
import pytest
5
-
6
5
import xarray as xr
7
-
8
6
from pint .quantity import Quantity
9
7
10
8
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ exclude=
30
30
31
31
[isort]
32
32
default_section = THIRDPARTY
33
- known_first_party = pintxarray
33
+ known_first_party = pint_xarray
34
34
multi_line_output = 3
35
35
include_trailing_comma = True
36
36
force_grid_wrap = 0
You can’t perform that action at this time.
0 commit comments