diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eed39e54395..b7b475e236b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,7 @@ repos: hooks: - id: absolufy-imports name: absolufy-imports + files: ^xarray/ # This wants to go before isort & flake8 - repo: https://github.com/PyCQA/autoflake rev: "v2.0.0" diff --git a/asv_bench/benchmarks/dataarray_missing.py b/asv_bench/benchmarks/dataarray_missing.py index 124da03eadd..d786c04e852 100644 --- a/asv_bench/benchmarks/dataarray_missing.py +++ b/asv_bench/benchmarks/dataarray_missing.py @@ -1,7 +1,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import parameterized, randn, requires_dask + +from . import parameterized, randn, requires_dask def make_bench_data(shape, frac_nan, chunks): diff --git a/asv_bench/benchmarks/dataset_io.py b/asv_bench/benchmarks/dataset_io.py index 104551d6858..6c2e15c54e9 100644 --- a/asv_bench/benchmarks/dataset_io.py +++ b/asv_bench/benchmarks/dataset_io.py @@ -4,7 +4,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import _skip_slow, randint, randn, requires_dask + +from . import _skip_slow, randint, randn, requires_dask try: import dask diff --git a/asv_bench/benchmarks/groupby.py b/asv_bench/benchmarks/groupby.py index e9176dc934f..490c2ccbd4c 100644 --- a/asv_bench/benchmarks/groupby.py +++ b/asv_bench/benchmarks/groupby.py @@ -2,7 +2,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import _skip_slow, parameterized, requires_dask + +from . import _skip_slow, parameterized, requires_dask class GroupBy: diff --git a/asv_bench/benchmarks/indexing.py b/asv_bench/benchmarks/indexing.py index 91881f246bd..15212ec0c61 100644 --- a/asv_bench/benchmarks/indexing.py +++ b/asv_bench/benchmarks/indexing.py @@ -4,7 +4,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import parameterized, randint, randn, requires_dask + +from . import parameterized, randint, randn, requires_dask nx = 2000 ny = 1000 diff --git a/asv_bench/benchmarks/interp.py b/asv_bench/benchmarks/interp.py index 5ca2df2ec1c..4b6691bcc0a 100644 --- a/asv_bench/benchmarks/interp.py +++ b/asv_bench/benchmarks/interp.py @@ -2,7 +2,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import parameterized, randn, requires_dask + +from . import parameterized, randn, requires_dask nx = 1500 ny = 1000 diff --git a/asv_bench/benchmarks/pandas.py b/asv_bench/benchmarks/pandas.py index 05b1991a808..8aaa515d417 100644 --- a/asv_bench/benchmarks/pandas.py +++ b/asv_bench/benchmarks/pandas.py @@ -2,7 +2,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import parameterized + +from . import parameterized class MultiIndexSeries: diff --git a/asv_bench/benchmarks/polyfit.py b/asv_bench/benchmarks/polyfit.py index 610dbf208eb..429ffa19baa 100644 --- a/asv_bench/benchmarks/polyfit.py +++ b/asv_bench/benchmarks/polyfit.py @@ -1,7 +1,8 @@ import numpy as np import xarray as xr -from asv_bench.benchmarks import parameterized, randn, requires_dask + +from . import parameterized, randn, requires_dask NDEGS = (2, 5, 20) NX = (10**2, 10**6) diff --git a/asv_bench/benchmarks/reindexing.py b/asv_bench/benchmarks/reindexing.py index 644480e48e8..9d0767fc3b3 100644 --- a/asv_bench/benchmarks/reindexing.py +++ b/asv_bench/benchmarks/reindexing.py @@ -1,7 +1,8 @@ import numpy as np import xarray as xr -from asv_bench.benchmarks import requires_dask + +from . import requires_dask ntime = 500 nx = 50 diff --git a/asv_bench/benchmarks/rolling.py b/asv_bench/benchmarks/rolling.py index d4fb0b20070..1d3713f19bf 100644 --- a/asv_bench/benchmarks/rolling.py +++ b/asv_bench/benchmarks/rolling.py @@ -2,7 +2,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import parameterized, randn, requires_dask + +from . import parameterized, randn, requires_dask nx = 300 long_nx = 30000 diff --git a/asv_bench/benchmarks/unstacking.py b/asv_bench/benchmarks/unstacking.py index 33158350bd4..dc8bc3307c3 100644 --- a/asv_bench/benchmarks/unstacking.py +++ b/asv_bench/benchmarks/unstacking.py @@ -2,7 +2,8 @@ import pandas as pd import xarray as xr -from asv_bench.benchmarks import requires_dask, requires_sparse + +from . import requires_dask, requires_sparse class Unstacking: diff --git a/doc/whats-new.rst b/doc/whats-new.rst index b66a0239fd3..e3b72e074c3 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -43,7 +43,7 @@ Documentation Internal Changes ~~~~~~~~~~~~~~~~ - Add the pre-commit hook `absolufy-imports` to convert relative xarray imports to - absolute imports (:pull:`7204`). + absolute imports (:pull:`7204`, :pull:`7370`). By `Jimmy Westling `_. .. _whats-new.2022.12.0: