From 1755ffa88d1b3b02cc45e9f2f082eaf97758c61e Mon Sep 17 00:00:00 2001 From: Sandor Kertesz Date: Tue, 20 Aug 2024 13:50:46 +0100 Subject: [PATCH 1/3] Update cdsapi minimum version to 0.7.1 (#434) --- docs/release_notes/version_0.9_updates.rst | 7 +++++++ environment.yml | 2 +- pyproject.toml | 6 +++--- tests/environment-unit-tests.yml | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/release_notes/version_0.9_updates.rst b/docs/release_notes/version_0.9_updates.rst index fe397fe8..11cdfd5d 100644 --- a/docs/release_notes/version_0.9_updates.rst +++ b/docs/release_notes/version_0.9_updates.rst @@ -1,6 +1,13 @@ Version 0.9 Updates ///////////////////////// +Version 0.9.4 +=============== + +Changes +++++++ + +- Increased the minimum version of the `cdsapi` package to 0.7.1. Version 0.9.3 =============== diff --git a/environment.yml b/environment.yml index 363ba7a5..856d6788 100644 --- a/environment.yml +++ b/environment.yml @@ -19,7 +19,7 @@ dependencies: - entrypoints - jupyterlab - ecmwf-api-client>=1.6.1 -- cdsapi +- cdsapi>=0.7.1 - hda - pip: - multiurl diff --git a/pyproject.toml b/pyproject.toml index 9229c1bf..46c99f53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ dependencies = [ ] optional-dependencies.all = [ "cartopy", - "cdsapi", + "cdsapi>=0.7.1", "eccovjson>=0.0.5", "ecmwf-api-client>=1.6.1", "ecmwf-opendata>=0.3.3", @@ -62,7 +62,7 @@ optional-dependencies.all = [ "pyodc", ] optional-dependencies.cds = [ - "cdsapi", + "cdsapi>=0.7.1", ] optional-dependencies.ci = [ "array-api-compat", @@ -70,7 +70,7 @@ optional-dependencies.ci = [ ] optional-dependencies.dev = [ "cartopy", - "cdsapi", + "cdsapi>=0.7.1", "earthkit-data-demo-source", "eccovjson>=0.0.5", "ecmwf-api-client>=1.6.1", diff --git a/tests/environment-unit-tests.yml b/tests/environment-unit-tests.yml index 14f936c9..5b72f25c 100644 --- a/tests/environment-unit-tests.yml +++ b/tests/environment-unit-tests.yml @@ -20,7 +20,7 @@ dependencies: - entrypoints - jupyterlab - ecmwf-api-client>=1.6.1 -- cdsapi +- cdsapi>=0.7.1 - hda - jsonschema - pip: From 61dfca7df9fae5314c711e2471c7797d0a9d8e3f Mon Sep 17 00:00:00 2001 From: Sandor Kertesz Date: Tue, 20 Aug 2024 15:07:21 +0100 Subject: [PATCH 2/3] Add ni nj to grib1 geography summary tests (#435) --- tests/array_fieldlist/test_numpy_fs_summary.py | 2 ++ tests/grib/test_grib_summary.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/array_fieldlist/test_numpy_fs_summary.py b/tests/array_fieldlist/test_numpy_fs_summary.py index 0d44762a..9fcf6258 100644 --- a/tests/array_fieldlist/test_numpy_fs_summary.py +++ b/tests/array_fieldlist/test_numpy_fs_summary.py @@ -56,6 +56,8 @@ def test_array_fl_dump(): "title": "geography", "data": { # "bitmapPresent": 0, + "Ni": 12, + "Nj": 7, "latitudeOfFirstGridPointInDegrees": 90.0, "longitudeOfFirstGridPointInDegrees": 0.0, "latitudeOfLastGridPointInDegrees": -90.0, diff --git a/tests/grib/test_grib_summary.py b/tests/grib/test_grib_summary.py index af06b4fb..2dc87cf8 100644 --- a/tests/grib/test_grib_summary.py +++ b/tests/grib/test_grib_summary.py @@ -409,6 +409,8 @@ def test_grib_dump(fl_type, array_backend): { "title": "geography", "data": { + "Ni": 12, + "Nj": 7, "bitmapPresent": 0, "latitudeOfFirstGridPointInDegrees": 90.0, "longitudeOfFirstGridPointInDegrees": 0.0, From 61d01745e234739e58895669dc585fd1971ec225 Mon Sep 17 00:00:00 2001 From: Sandor Kertesz Date: Tue, 3 Sep 2024 12:01:46 +0100 Subject: [PATCH 3/3] Add release notes for 0.10.0 (#440) * Add release notes for 0.10.0 --- docs/conf.py | 5 ++++ docs/guide/caching.rst | 2 +- docs/release_notes/index.rst | 1 + docs/release_notes/version_0.10_updates.rst | 26 +++++++++++++++++++++ docs/release_notes/version_0.9_updates.rst | 2 +- docs/requirements.txt | 1 + environment.yml | 1 + src/earthkit/data/core/index.py | 6 ++--- tests/environment-unit-tests.yml | 1 + 9 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 docs/release_notes/version_0.10_updates.rst diff --git a/docs/conf.py b/docs/conf.py index 462feb84..d4e0c549 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,6 +37,7 @@ "sphinx.ext.napoleon", "sphinx.ext.intersphinx", "autoapi.extension", + "sphinx_issues", "earthkit.data.sphinxext.xref", "earthkit.data.sphinxext.module_output", ] @@ -63,6 +64,10 @@ napoleon_numpy_docstring = True napoleon_preprocess_types = True +# Path to GitHub repo {group}/{project} (note that `group` is the GitHub user or organization) +issues_github_path = "ecmwf/earthkit-data" + + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/docs/guide/caching.rst b/docs/guide/caching.rst index 65fe0edc..6cffdaf8 100644 --- a/docs/guide/caching.rst +++ b/docs/guide/caching.rst @@ -142,7 +142,7 @@ The following code shows how to change the ``user-cache-directory`` settings: >>> settings.get("user-cache-directory") # Find the current cache directory /tmp/earthkit-data-myusername >>> # Change the value of the setting - >>> settings.set("cache-user-directory", "/big-disk/earthkit-data-cache") + >>> settings.set("user-cache-directory", "/big-disk/earthkit-data-cache") # Python kernel restarted diff --git a/docs/release_notes/index.rst b/docs/release_notes/index.rst index 112c58d4..47704288 100644 --- a/docs/release_notes/index.rst +++ b/docs/release_notes/index.rst @@ -4,6 +4,7 @@ Release notes .. toctree:: :maxdepth: 1 + version_0.10_updates version_0.9_updates version_0.8_updates version_0.7_updates diff --git a/docs/release_notes/version_0.10_updates.rst b/docs/release_notes/version_0.10_updates.rst new file mode 100644 index 00000000..66522bdd --- /dev/null +++ b/docs/release_notes/version_0.10_updates.rst @@ -0,0 +1,26 @@ +Version 0.10 Updates +///////////////////////// + + +Version 0.10.0 +=============== + +New features +++++++++++++++++ + +- Refined :ref:`GRIB` data memory management when reading from a file (:pr:`428`). See :ref:`grib-memory` for an overview. +- Refined how GRIB the metadata object manages the GRIB handle (:pr:`430`). See the :ref:`/examples/grib_metadata_object.ipynb` notebook example for details. +- Added the ``index`` keyword argument for data subsetting to the following methods (:pr:`407`): + + - field: :meth:`~data.core.fieldlist.Field.to_numpy`, :meth:`~data.core.fieldlist.Field.to_array`, :meth:`~data.core.fieldlist.Field.data`, :meth:`~data.core.fieldlist.Field.to_latlon`, :meth:`~data.core.fieldlist.Field.to_points` + - fieldlist: :meth:`~data.core.fieldlist.FieldList.to_numpy`, :meth:`~data.core.fieldlist.FieldList.to_array`, :meth:`~data.core.fieldlist.FieldList.data`, :meth:`~data.core.fieldlist.FieldList.to_latlon`, :meth:`~data.core.fieldlist.FieldList.to_points` + +- Removed normalisation of GRIB metadata keys when passed to methods like :meth:`~data.core.fieldlist.FieldList.sel`, :meth:`~data.core.fieldlist.FieldList.isel`, :meth:`~data.core.fieldlist.FieldList.order_by` and :func:`unique_values` (:pr:`429`). + +- Improved the implementation of :meth:`~data.core.fieldlist.FieldList.indices` and :meth:`~data.core.fieldlist.FieldList.index` (:pr:`436`) +- Changed the default to False for the ``progress_bar`` keyword argument in :func:`unique_values` + +Installation +++++++++++++ + +Increased minimum version of `cdsapi` to be compatible with the new CDS beta services (:pr:`433`). diff --git a/docs/release_notes/version_0.9_updates.rst b/docs/release_notes/version_0.9_updates.rst index 11cdfd5d..ccf9c194 100644 --- a/docs/release_notes/version_0.9_updates.rst +++ b/docs/release_notes/version_0.9_updates.rst @@ -5,7 +5,7 @@ Version 0.9.4 =============== Changes -++++++ ++++++++ - Increased the minimum version of the `cdsapi` package to 0.7.1. diff --git a/docs/requirements.txt b/docs/requirements.txt index fabb4f4e..f01406a9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,6 +7,7 @@ sphinx-rtd-theme nbsphinx setuptools sphinx-autoapi +sphinx-issues entrypoints pandas tqdm diff --git a/environment.yml b/environment.yml index 3e3a029d..a903e5ef 100644 --- a/environment.yml +++ b/environment.yml @@ -46,6 +46,7 @@ dependencies: - sphinx-autoapi>=3.0.0 - sphinx_rtd_theme - sphinxcontrib-apidoc +- sphinx-issues - nbformat - nbconvert - nbsphinx diff --git a/src/earthkit/data/core/index.py b/src/earthkit/data/core/index.py index 2ee3caac..0cf74340 100644 --- a/src/earthkit/data/core/index.py +++ b/src/earthkit/data/core/index.py @@ -475,10 +475,10 @@ def order_by(self, *args, remapping=None, patches=None, **kwargs): (we created key "param_level" from "param" and "levelist"): >>> ordering = ["t850", "t1000", "u1000", "v850", "v1000", "u850"] - >>> for f in ds.order_by( - ... param_level=ordering, remapping={"param_level": "{param}{levelist}"} - ... ): + >>> remapping = {"param_level": "{param}{levelist}"} + >>> for f in ds.order_by(param_level=ordering, remapping=remapping): ... print(f) + ... GribField(t,850,20180801,1200,0,0) GribField(t,1000,20180801,1200,0,0) GribField(u,1000,20180801,1200,0,0) diff --git a/tests/environment-unit-tests.yml b/tests/environment-unit-tests.yml index d3de8854..1da2d6bd 100644 --- a/tests/environment-unit-tests.yml +++ b/tests/environment-unit-tests.yml @@ -48,6 +48,7 @@ dependencies: - sphinx-autoapi - sphinx_rtd_theme - sphinxcontrib-apidoc +- sphinx-issues - nbformat - nbconvert - nbsphinx