Skip to content

Commit 4682c5b

Browse files
Merge pull request #411 from ecmwf/develop
Release 0.9.0
2 parents 798c8ce + 4973af9 commit 4682c5b

File tree

180 files changed

+1037
-1373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+1037
-1373
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
earthkit-data: ecmwf/earthkit-data@${{ github.event.pull_request.head.sha || github.sha }}
3030
codecov_upload: true
31-
python_qa: true
31+
python_qa: false
3232
secrets: inherit
3333

3434

.pre-commit-config.yaml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.6.0
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
@@ -10,14 +10,21 @@ repos:
1010
# - id: check-added-large-files
1111
- id: debug-statements
1212
- id: mixed-line-ending
13+
- id: no-commit-to-branch # Prevent committing to main / master
14+
- id: check-merge-conflict # Check for files that contain merge conflict
1315
- repo: https://github.com/PyCQA/isort
14-
rev: 5.12.0
16+
rev: 5.13.0
1517
hooks:
1618
- id: isort
19+
args:
20+
- -l 110
21+
- --force-single-line-imports
22+
- --profile black
1723
- repo: https://github.com/psf/black
1824
rev: 24.4.2
1925
hooks:
2026
- id: black
27+
args: [--line-length=110]
2128
- repo: https://github.com/keewis/blackdoc
2229
rev: v0.3.8
2330
hooks:
@@ -27,6 +34,16 @@ repos:
2734
rev: 6.1.0
2835
hooks:
2936
- id: flake8
37+
- repo: https://github.com/astral-sh/ruff-pre-commit
38+
rev: v0.4.6
39+
hooks:
40+
- id: ruff
41+
exclude: '(dev/.*|.*_)\.py$'
42+
args:
43+
- --line-length=110
44+
- --fix
45+
- --exit-non-zero-on-fix
46+
- --preview
3047
- repo: https://github.com/executablebooks/mdformat
3148
rev: 0.7.14
3249
hooks:
@@ -37,11 +54,25 @@ repos:
3754
hooks:
3855
- id: pretty-format-yaml
3956
args: [--autofix, --preserve-quotes]
40-
- id: pretty-format-toml
41-
args: [--autofix]
57+
# - id: pretty-format-toml
58+
# args: [--autofix]
59+
# - repo: https://github.com/b8raoult/pre-commit-docconvert
60+
# rev: "0.1.4"
61+
# hooks:
62+
# - id: docconvert
63+
# args: ["numpy"]
4264
- repo: https://github.com/PyCQA/pydocstyle.git
4365
rev: 6.1.1
4466
hooks:
4567
- id: pydocstyle
4668
additional_dependencies: [toml]
4769
exclude: tests|docs
70+
- repo: https://github.com/b8raoult/optional-dependencies-all
71+
rev: "0.0.2"
72+
hooks:
73+
- id: optional-dependencies-all
74+
args: ["--inplace", "--all-key", "all", "--exclude-keys", "dev,docs,test"]
75+
- repo: https://github.com/tox-dev/pyproject-fmt
76+
rev: "2.1.3"
77+
hooks:
78+
- id: pyproject-fmt

docs/guide/include/settings-set.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
# Multiple values can be set together. The argument list
1010
# can be a dictionary:
11-
earthkit.data.settings.set(
12-
{"number-of-download-threads": 7, "url-download-timeout": "1m"}
13-
)
11+
earthkit.data.settings.set({"number-of-download-threads": 7, "url-download-timeout": "1m"})
1412

1513
# Alternatively, we can use keyword arguments. However, because
1614
# the “-” character is not allowed in variable names in Python we have

docs/release_notes/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Release notes
44
.. toctree::
55
:maxdepth: 1
66

7+
version_0.9_updates
78
version_0.8_updates
89
version_0.7_updates
910
version_0.6_updates
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Version 0.9 Updates
2+
/////////////////////////
3+
4+
Version 0.9.1
5+
===============
6+
7+
New features
8+
++++++++++++++++
9+
10+
- Renamed the ``constants`` source to ``forcings``
11+
- Enabled the NetCDF field parser to recognise the following additional coordinates: "X", "xc", "Y" and "yc"
12+
- Split encoding from writing in experimental GRIB output generator
13+
14+
Fixes
15+
++++++
16+
17+
- Fixed issue when NetCDF data containing cftime dates could not be read
18+
- Fixed issue when NetCDF data containing coordinates called "lat" and "lon" could not be read correctly

pyproject.toml

Lines changed: 112 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
[build-system]
2-
requires = ["setuptools>=61", "setuptools-scm>=8.0"]
2+
requires = [
3+
"setuptools>=61",
4+
"setuptools-scm>=8",
5+
]
36

47
[project]
8+
name = "earthkit-data"
9+
description = "A format-agnostic Python interface for geospatial data"
10+
readme = "README.md"
11+
license = { text = "Apache License Version 2.0" }
512
authors = [
6-
{name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int"}
13+
{ name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int" },
714
]
15+
requires-python = ">=3.8"
816
classifiers = [
917
"Development Status :: 2 - Pre-Alpha",
1018
"Intended Audience :: Developers",
1119
"License :: OSI Approved :: Apache Software License",
12-
"Programming Language :: Python :: 3",
20+
"Operating System :: OS Independent",
21+
"Programming Language :: Python :: 3 :: Only",
1322
"Programming Language :: Python :: 3.8",
1423
"Programming Language :: Python :: 3.9",
1524
"Programming Language :: Python :: 3.10",
1625
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
1727
"Programming Language :: Python :: Implementation :: CPython",
1828
"Programming Language :: Python :: Implementation :: PyPy",
19-
"Operating System :: OS Independent"
29+
]
30+
dynamic = [
31+
"version",
2032
]
2133
dependencies = [
2234
"cfgrib>=0.9.10.1",
23-
"eccodes>=1.7.0",
2435
"dask",
36+
"earthkit-geo>=0.2",
37+
"earthkit-meteo>=0.0.1",
38+
"eccodes>=1.7",
2539
"entrypoints",
2640
"filelock",
2741
"jinja2",
@@ -30,72 +44,112 @@ dependencies = [
3044
"multiurl",
3145
"netcdf4",
3246
"pandas",
33-
"pdbufr>=0.11.0",
47+
"pdbufr>=0.11",
3448
"pyyaml",
35-
"tqdm>=4.63.0",
36-
"xarray>=0.19.0",
37-
"earthkit-geo>=0.2.0",
38-
"earthkit-meteo>=0.0.1"
49+
"tqdm>=4.63",
50+
"xarray>=0.19",
3951
]
40-
description = "A format-agnostic Python interface for geospatial data"
41-
dynamic = ["version"]
42-
license = {text = "Apache License Version 2.0"}
43-
name = "earthkit-data"
44-
readme = "README.md"
45-
requires-python = ">= 3.8"
46-
47-
[project.optional-dependencies]
48-
all = [
49-
"earthkit-data[mars]",
50-
"earthkit-data[cds]",
51-
"earthkit-data[ecmwf-opendata]",
52-
"earthkit-data[fdb]",
53-
"earthkit-data[polytope]",
54-
"earthkit-data[wekeo]",
55-
"earthkit-data[odb]",
56-
"earthkit-data[projection]",
57-
"earthkit-data[geopandas]",
58-
"earthkit-data[eccovjson]"
59-
]
60-
cds = ["cdsapi"]
61-
eccovjson = ["eccovjson>=0.0.5"]
62-
ecmwf-opendata = ["ecmwf-opendata>=0.3.3"]
63-
fdb = ["pyfdb"]
64-
geopandas = ["geopandas"]
65-
mars = ["ecmwf-api-client>=1.6.1"]
66-
odb = ["pyodc"]
67-
polytope = ["polytope-client>=0.7.4"]
68-
projection = ["cartopy"]
69-
test = [
70-
"earthkit-data[all]",
52+
optional-dependencies.all = [
53+
"cartopy",
54+
"cdsapi",
55+
"cfgrib>=0.9.10.1",
56+
"dask",
57+
"earthkit-geo>=0.2",
58+
"earthkit-meteo>=0.0.1",
59+
"eccodes>=1.7",
60+
"eccovjson>=0.0.5",
61+
"ecmwf-api-client>=1.6.1",
62+
"ecmwf-opendata>=0.3.3",
63+
"entrypoints",
64+
"filelock",
65+
"geopandas",
66+
"hda",
67+
"jinja2",
68+
"jsonschema",
69+
"markdown",
70+
"multiurl",
71+
"nbconvert",
72+
"nbformat",
73+
"netcdf4",
74+
"pandas",
75+
"pdbufr>=0.11",
76+
"polytope-client>=0.7.4",
77+
"pyfdb",
78+
"pyodc",
7179
"pytest",
7280
"pytest-cov",
7381
"pytest-forked",
7482
"pytest-timeout",
83+
"pyyaml",
84+
"tqdm>=4.63",
85+
"xarray>=0.19",
86+
]
87+
optional-dependencies.cds = [
88+
"cdsapi",
89+
]
90+
optional-dependencies.eccovjson = [
91+
"eccovjson>=0.0.5",
92+
]
93+
optional-dependencies.ecmwf-opendata = [
94+
"ecmwf-opendata>=0.3.3",
95+
]
96+
optional-dependencies.fdb = [
97+
"pyfdb",
98+
]
99+
optional-dependencies.geopandas = [
100+
"geopandas",
101+
]
102+
optional-dependencies.mars = [
103+
"ecmwf-api-client>=1.6.1",
104+
]
105+
optional-dependencies.odb = [
106+
"pyodc",
107+
]
108+
optional-dependencies.polytope = [
109+
"polytope-client>=0.7.4",
110+
]
111+
optional-dependencies.projection = [
112+
"cartopy",
113+
]
114+
optional-dependencies.test = [
115+
"nbconvert",
75116
"nbformat",
76-
"nbconvert"
117+
"pytest",
118+
"pytest-cov",
119+
"pytest-forked",
120+
"pytest-timeout",
121+
]
122+
optional-dependencies.wekeo = [
123+
"hda",
77124
]
78-
wekeo = ["hda"]
125+
urls.Documentation = "https://earthkit-data.readthedocs.io/"
126+
urls.Homepage = "https://github.com/ecmwf/earthkit-data/"
127+
urls.Issues = "https://github.com/ecmwf/earthkit-data.issues"
128+
urls.Repository = "https://github.com/ecmwf/earthkit-data/"
79129

80-
[project.urls]
81-
Documentation = "https://earthkit-data.readthedocs.io/"
82-
Homepage = "https://github.com/ecmwf/earthkit-data/"
83-
Issues = "https://github.com/ecmwf/earthkit-data.issues"
84-
Repository = "https://github.com/ecmwf/earthkit-data/"
130+
[tool.setuptools.packages.find]
131+
include = [
132+
"earthkit.data",
133+
]
134+
where = [
135+
"src/",
136+
]
85137

86-
[tool.coverage.run]
87-
branch = "true"
138+
[tool.setuptools_scm]
139+
version_file = "src/earthkit/data/_version.py"
88140

89141
[tool.isort]
90142
profile = "black"
91143

144+
[tool.coverage.run]
145+
branch = "true"
146+
92147
[tool.pydocstyle]
93-
add_ignore = ["D1", "D200", "D205", "D400", "D401"]
148+
add_ignore = [
149+
"D1",
150+
"D200",
151+
"D205",
152+
"D400",
153+
"D401",
154+
]
94155
convention = "numpy"
95-
96-
[tool.setuptools.packages.find]
97-
include = ["earthkit.data"]
98-
where = ["src/"]
99-
100-
[tool.setuptools_scm]
101-
version_file = "src/earthkit/data/_version.py"

src/earthkit/data/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@
2323
from .core.fieldlist import FieldList
2424
from .core.settings import SETTINGS as settings
2525
from .readers.grib.output import new_grib_output
26-
from .sources import Source, from_source, from_source_lazily
27-
from .utils.examples import download_example_file, remote_example_file
26+
from .sources import Source
27+
from .sources import from_source
28+
from .sources import from_source_lazily
29+
from .utils.examples import download_example_file
30+
from .utils.examples import remote_example_file
2831

2932
__all__ = [
3033
"ALL",

src/earthkit/data/arguments/argument.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
import logging
1010

1111
from earthkit.data.arguments.earthkit_types import infer_type
12-
from earthkit.data.arguments.transformers import (
13-
AliasTransformer,
14-
FormatTransformer,
15-
TypeTransformer,
16-
)
12+
from earthkit.data.arguments.transformers import AliasTransformer
13+
from earthkit.data.arguments.transformers import FormatTransformer
14+
from earthkit.data.arguments.transformers import TypeTransformer
1715

1816
LOG = logging.getLogger(__name__)
1917

0 commit comments

Comments
 (0)