From 1c45cd580a53d3f5770ac22a3af4655d70d532a9 Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Tue, 4 Mar 2025 08:21:27 +0000 Subject: [PATCH 1/6] resturcture code --- {earthkit => src/earthkit}/transforms/__init__.py | 0 {earthkit => src/earthkit}/transforms/aggregate/__init__.py | 0 {earthkit => src/earthkit}/transforms/aggregate/climatology.py | 0 {earthkit => src/earthkit}/transforms/aggregate/general.py | 0 {earthkit => src/earthkit}/transforms/aggregate/spatial.py | 0 {earthkit => src/earthkit}/transforms/aggregate/temporal.py | 0 {earthkit => src/earthkit}/transforms/tools.py | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename {earthkit => src/earthkit}/transforms/__init__.py (100%) rename {earthkit => src/earthkit}/transforms/aggregate/__init__.py (100%) rename {earthkit => src/earthkit}/transforms/aggregate/climatology.py (100%) rename {earthkit => src/earthkit}/transforms/aggregate/general.py (100%) rename {earthkit => src/earthkit}/transforms/aggregate/spatial.py (100%) rename {earthkit => src/earthkit}/transforms/aggregate/temporal.py (100%) rename {earthkit => src/earthkit}/transforms/tools.py (100%) diff --git a/earthkit/transforms/__init__.py b/src/earthkit/transforms/__init__.py similarity index 100% rename from earthkit/transforms/__init__.py rename to src/earthkit/transforms/__init__.py diff --git a/earthkit/transforms/aggregate/__init__.py b/src/earthkit/transforms/aggregate/__init__.py similarity index 100% rename from earthkit/transforms/aggregate/__init__.py rename to src/earthkit/transforms/aggregate/__init__.py diff --git a/earthkit/transforms/aggregate/climatology.py b/src/earthkit/transforms/aggregate/climatology.py similarity index 100% rename from earthkit/transforms/aggregate/climatology.py rename to src/earthkit/transforms/aggregate/climatology.py diff --git a/earthkit/transforms/aggregate/general.py b/src/earthkit/transforms/aggregate/general.py similarity index 100% rename from earthkit/transforms/aggregate/general.py rename to src/earthkit/transforms/aggregate/general.py diff --git a/earthkit/transforms/aggregate/spatial.py b/src/earthkit/transforms/aggregate/spatial.py similarity index 100% rename from earthkit/transforms/aggregate/spatial.py rename to src/earthkit/transforms/aggregate/spatial.py diff --git a/earthkit/transforms/aggregate/temporal.py b/src/earthkit/transforms/aggregate/temporal.py similarity index 100% rename from earthkit/transforms/aggregate/temporal.py rename to src/earthkit/transforms/aggregate/temporal.py diff --git a/earthkit/transforms/tools.py b/src/earthkit/transforms/tools.py similarity index 100% rename from earthkit/transforms/tools.py rename to src/earthkit/transforms/tools.py From f0232a60718f1b036151c344d3f7886a5a68f990 Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Tue, 4 Mar 2025 08:27:38 +0000 Subject: [PATCH 2/6] src dir --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8cdd170..39679c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ select = [ packages = ["earthkit.transforms"] [tool.setuptools_scm] -write_to = "earthkit/transforms/version.py" +write_to = "src/earthkit/transforms/version.py" write_to_template = ''' # Do not change! Do not track in version control! __version__ = "{version}" From 5d0d417254674300d5735c86f556415375015b97 Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Tue, 4 Mar 2025 08:35:38 +0000 Subject: [PATCH 3/6] pyproject.toml --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 39679c0..16a5b6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = ["setuptools>=64", "setuptools_scm>=8"] [project] classifiers = [ - "Development Status :: 2 - Pre-Alpha", + "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", @@ -68,8 +68,9 @@ select = [ "D" ] -[tool.setuptools] -packages = ["earthkit.transforms"] +[tool.setuptools.packages.find] +include = [ "earthkit.transforms" ] +where = [ "src/" ] [tool.setuptools_scm] write_to = "src/earthkit/transforms/version.py" From c5a79fde114ee3e8ae24d6c6aeab3c42bd9f8f9e Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Tue, 4 Mar 2025 08:39:30 +0000 Subject: [PATCH 4/6] QA --- pyproject.toml | 4 ++-- src/earthkit/transforms/aggregate/climatology.py | 1 - src/earthkit/transforms/aggregate/general.py | 1 - src/earthkit/transforms/aggregate/spatial.py | 1 - src/earthkit/transforms/aggregate/temporal.py | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 16a5b6c..5c50fa4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,8 +69,8 @@ select = [ ] [tool.setuptools.packages.find] -include = [ "earthkit.transforms" ] -where = [ "src/" ] +include = ["earthkit.transforms"] +where = ["src/"] [tool.setuptools_scm] write_to = "src/earthkit/transforms/version.py" diff --git a/src/earthkit/transforms/aggregate/climatology.py b/src/earthkit/transforms/aggregate/climatology.py index f279bbd..363ef1d 100644 --- a/src/earthkit/transforms/aggregate/climatology.py +++ b/src/earthkit/transforms/aggregate/climatology.py @@ -1,7 +1,6 @@ import typing as T import xarray as xr - from earthkit.transforms import tools from earthkit.transforms.aggregate.general import reduce as _reduce from earthkit.transforms.aggregate.general import resample diff --git a/src/earthkit/transforms/aggregate/general.py b/src/earthkit/transforms/aggregate/general.py index eb237b3..8b48583 100644 --- a/src/earthkit/transforms/aggregate/general.py +++ b/src/earthkit/transforms/aggregate/general.py @@ -2,7 +2,6 @@ import numpy as np import xarray as xr - from earthkit.transforms import tools diff --git a/src/earthkit/transforms/aggregate/spatial.py b/src/earthkit/transforms/aggregate/spatial.py index b9e6494..ecb99c6 100644 --- a/src/earthkit/transforms/aggregate/spatial.py +++ b/src/earthkit/transforms/aggregate/spatial.py @@ -6,7 +6,6 @@ import numpy as np import pandas as pd import xarray as xr - from earthkit.transforms.tools import ensure_list, get_how, get_spatial_info, standard_weights logger = logging.getLogger(__name__) diff --git a/src/earthkit/transforms/aggregate/temporal.py b/src/earthkit/transforms/aggregate/temporal.py index 05eb314..6d0b215 100644 --- a/src/earthkit/transforms/aggregate/temporal.py +++ b/src/earthkit/transforms/aggregate/temporal.py @@ -4,7 +4,6 @@ import numpy as np import pandas as pd import xarray as xr - from earthkit.transforms import tools from earthkit.transforms.aggregate.general import how_label_rename, resample from earthkit.transforms.aggregate.general import reduce as _reduce From c17630dc7a029d036e833dc30298209e67318b19 Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Tue, 4 Mar 2025 08:43:12 +0000 Subject: [PATCH 5/6] docs --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 274c3d6..354625b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,7 +45,7 @@ autodoc_typehints = "none" # autoapi configuration -autoapi_dirs = ["../earthkit/transforms"] +autoapi_dirs = ["../src/earthkit/transforms"] autoapi_ignore = ["*/version.py", "*/aggregate/general.py"] autoapi_options = [ "members", From 43434841ba0206fcc895e8f3cc871b3b3625d176 Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Tue, 4 Mar 2025 09:53:09 +0000 Subject: [PATCH 6/6] QA --- tests/test_10_tools.py | 1 - tests/test_20_general.py | 1 - tests/test_30_spatial.py | 1 - tests/test_30_temporal.py | 1 - tests/test_40_climatology.py | 1 - 5 files changed, 5 deletions(-) diff --git a/tests/test_10_tools.py b/tests/test_10_tools.py index 6206d65..b45a17d 100644 --- a/tests/test_10_tools.py +++ b/tests/test_10_tools.py @@ -4,7 +4,6 @@ import pandas as pd import pytest import xarray as xr - from earthkit.transforms.tools import ( get_dim_key, get_how, diff --git a/tests/test_20_general.py b/tests/test_20_general.py index a4f5ec4..821c27c 100644 --- a/tests/test_20_general.py +++ b/tests/test_20_general.py @@ -1,7 +1,6 @@ import numpy as np import pytest import xarray as xr - from earthkit.transforms.aggregate.general import ( _reduce_dataarray, _rolling_reduce_dataarray, diff --git a/tests/test_30_spatial.py b/tests/test_30_spatial.py index 99a3ac5..1740e0d 100644 --- a/tests/test_30_spatial.py +++ b/tests/test_30_spatial.py @@ -4,7 +4,6 @@ # from earthkit.data.core.temporary import temp_directory import xarray as xr - from earthkit import data as ek_data from earthkit.data.testing import earthkit_remote_test_data_file from earthkit.transforms.aggregate import spatial diff --git a/tests/test_30_temporal.py b/tests/test_30_temporal.py index 4a50311..9a5f142 100644 --- a/tests/test_30_temporal.py +++ b/tests/test_30_temporal.py @@ -4,7 +4,6 @@ # from earthkit.data.core.temporary import temp_directory import xarray as xr - from earthkit import data as ek_data from earthkit.data.testing import earthkit_remote_test_data_file from earthkit.transforms.aggregate import temporal diff --git a/tests/test_40_climatology.py b/tests/test_40_climatology.py index 633e70a..8133c3b 100644 --- a/tests/test_40_climatology.py +++ b/tests/test_40_climatology.py @@ -2,7 +2,6 @@ # from earthkit.data.core.temporary import temp_directory import xarray as xr - from earthkit import data as ek_data from earthkit.data.testing import earthkit_remote_test_data_file from earthkit.transforms.aggregate import climatology