Skip to content

Commit c1fbe14

Browse files
Merge pull request #532 from ecmwf/develop
Prepare release 0.11.0
2 parents bb84b9e + 837f240 commit c1fbe14

File tree

225 files changed

+36114
-4045
lines changed

Some content is hidden

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

225 files changed

+36114
-4045
lines changed

.github/workflows/cd-pypi.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,7 @@ on:
55
tags:
66
- '**'
77

8-
# jobs:
9-
# pypi:
10-
# uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
11-
# secrets: inherit
12-
138
jobs:
149
deploy:
15-
if: ${{ github.ref_type == 'tag' }}
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Set up Python
21-
uses: actions/setup-python@v4
22-
with:
23-
python-version: 3.x
24-
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install build wheel twine
29-
30-
- name: Build and publish
31-
env:
32-
TWINE_USERNAME: __token__
33-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
34-
run: |
35-
python -m build
36-
twine upload dist/*
10+
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
11+
secrets: inherit

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,25 @@ on:
88
- 'develop'
99
tags-ignore:
1010
- '**'
11+
paths-ignore:
12+
- "docs/**"
13+
- "README.md"
1114

1215
# Trigger the workflow on pull request
1316
pull_request:
17+
paths-ignore:
18+
- "docs/**"
19+
- "README.md"
1420

1521
# Trigger the workflow manually
1622
workflow_dispatch:
1723

1824
# Trigger after public PR approved for CI
1925
pull_request_target:
2026
types: [labeled]
27+
paths-ignore:
28+
- "docs/**"
29+
- "README.md"
2130

2231
jobs:
2332
# Run CI including downstream packages on self-hosted runners

.github/workflows/legacy-ci.yml

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,32 @@ defaults:
2424
shell: bash -l {0}
2525

2626
jobs:
27-
pre-commit:
28-
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v3
32-
with:
33-
ref: ${{ github.event.pull_request.head.sha || github.ref }}
34-
- uses: actions/setup-python@v4
35-
with:
36-
python-version: 3.x
37-
- uses: pre-commit/action@v3.0.0
27+
# unit-tests-no-eccodes:
28+
# name: unit-tests (3.10)
29+
# if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
30+
# runs-on: ubuntu-latest
3831

39-
unit-tests-no-eccodes:
40-
name: unit-tests (3.10)
41-
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
42-
runs-on: ubuntu-latest
43-
44-
steps:
45-
- uses: actions/checkout@v3
46-
with:
47-
ref: ${{ github.event.pull_request.head.sha || github.ref }}
48-
- name: Install Conda environment with Micromamba
49-
uses: mamba-org/setup-micromamba@v1
50-
with:
51-
environment-file: tests/environment-unit-tests.yml
52-
environment-name: DEVELOP
53-
channels: conda-forge
54-
cache-environment: true
55-
cache-env-key: ubuntu-latest-3.10-no-eccodes
56-
create-args: >-
57-
python=3.10
58-
- name: Install package
59-
run: |
60-
python -m pip install --no-deps -e .
61-
micromamba remove eccodes
62-
- name: Run tests without eccodes
63-
run: |
64-
python -m pytest -v -m 'no_eccodes'
32+
# steps:
33+
# - uses: actions/checkout@v3
34+
# with:
35+
# ref: ${{ github.event.pull_request.head.sha || github.ref }}
36+
# - name: Install Conda environment with Micromamba
37+
# uses: mamba-org/setup-micromamba@v1
38+
# with:
39+
# environment-file: tests/environment-unit-tests.yml
40+
# environment-name: DEVELOP
41+
# channels: conda-forge
42+
# cache-environment: true
43+
# cache-env-key: ubuntu-latest-3.10-no-eccodes
44+
# create-args: >-
45+
# python=3.10
46+
# - name: Install package
47+
# run: |
48+
# python -m pip install --no-deps -e .
49+
# micromamba remove eccodes
50+
# - name: Run tests without eccodes
51+
# run: |
52+
# python -m pytest -v -m 'no_eccodes'
6553

6654

6755
documentation:
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Code Quality checks for PRs
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [opened, synchronize, reopened]
7+
8+
jobs:
9+
quality:
10+
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2
11+
with:
12+
skip-hooks: "no-commit-to-branch"

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,10 @@ docs/examples/*.zip
214214
docs/examples/_*
215215
docs/examples/earthkit_use_cases/*.grib
216216
docs/examples/_fdb
217-
docs/examples/*.db
218-
docs/examples/*.json
219-
docs/examples/*.geojson
217+
docs/experimental/_*
218+
docs/experimental/*.grib*
219+
docs/experimental/*.png
220+
220221

221222
# PyBuilder
222223
.pybuilder/
@@ -364,3 +365,5 @@ notebooks/data/*/
364365
_dev
365366

366367
test.db
368+
369+
*.idx

.pre-commit-config.yaml

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
5+
- id: trailing-whitespace # Trailing whitespace checker
6+
- id: end-of-file-fixer # Ensure files end in a newline
77
- id: check-json
8-
- id: check-yaml
8+
- id: check-yaml # Check YAML files for syntax errors only
9+
args: [--unsafe, --allow-multiple-documents]
910
- id: check-toml
10-
# - id: check-added-large-files
11-
- id: debug-statements
11+
# - id: check-added-large-files
12+
- id: debug-statements # Check for debugger imports and py37+ breakpoint()
1213
- 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
14+
- id: no-commit-to-branch # Prevent committing to main / master
15+
- id: check-merge-conflict # Check for files that contain merge conflict
16+
exclude: /README\.rst$|^docs/.*\.rst$
1517
- repo: https://github.com/PyCQA/isort
16-
rev: 5.13.0
18+
rev: 5.13.2
1719
hooks:
1820
- id: isort
1921
args:
2022
- -l 110
2123
- --force-single-line-imports
2224
- --profile black
2325
- repo: https://github.com/psf/black
24-
rev: 24.4.2
26+
rev: 24.8.0
2527
hooks:
2628
- id: black
2729
args: [--line-length=110]
@@ -30,12 +32,9 @@ repos:
3032
hooks:
3133
- id: blackdoc
3234
additional_dependencies: [black==23.3.0]
33-
- repo: https://github.com/PyCQA/flake8
34-
rev: 6.1.0
35-
hooks:
36-
- id: flake8
35+
exclude: xr_engine_profile_rst\.py
3736
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: v0.4.6
37+
rev: v0.6.9
3938
hooks:
4039
- id: ruff
4140
exclude: '(dev/.*|.*_)\.py$'
@@ -54,25 +53,11 @@ repos:
5453
hooks:
5554
- id: pretty-format-yaml
5655
args: [--autofix, --preserve-quotes]
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"]
64-
- repo: https://github.com/PyCQA/pydocstyle.git
65-
rev: 6.1.1
66-
hooks:
67-
- id: pydocstyle
68-
additional_dependencies: [toml]
69-
exclude: tests|docs
70-
- repo: https://github.com/b8raoult/optional-dependencies-all
71-
rev: "0.0.6"
56+
- repo: https://github.com/sphinx-contrib/sphinx-lint
57+
rev: v1.0.0
7258
hooks:
73-
- id: optional-dependencies-all
74-
args: ["--inplace", "--exclude-keys=ci,dev,docs,test", "--group=dev=all,docs,test"]
59+
- id: sphinx-lint
7560
- repo: https://github.com/tox-dev/pyproject-fmt
76-
rev: "2.1.3"
61+
rev: "v2.5.0"
7762
hooks:
7863
- id: pyproject-fmt

docs/api.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ CSV
4343

4444
- :py:class:`~data.readers.csv.CSVReader`
4545

46-
46+
Xarray engine
47+
--------------
48+
- :py:class:`~data.utils.xarray.engine.EarthkitBackendEntrypoint`
4749

4850
Other
4951
--------

docs/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
"sphinx.ext.intersphinx",
3939
"autoapi.extension",
4040
"sphinx_issues",
41+
"sphinx_tabs.tabs",
42+
"sphinx_copybutton",
4143
"earthkit.data.sphinxext.xref",
4244
"earthkit.data.sphinxext.module_output",
4345
]
@@ -67,6 +69,8 @@
6769
# Path to GitHub repo {group}/{project} (note that `group` is the GitHub user or organization)
6870
issues_github_path = "ecmwf/earthkit-data"
6971

72+
# sphinx_tabs configuration
73+
# sphinx_tabs_disable_css_loading = True
7074

7175
# Add any paths that contain templates here, relative to this directory.
7276
templates_path = ["_templates"]
@@ -95,6 +99,7 @@
9599
html_logo = "_static/earthkit-data.png"
96100

97101
xref_links = {
102+
"botocore": ("botocore", "https://botocore.amazonaws.com/v1/documentation/api/latest/index.html"),
98103
"cfgrib": ("cfgirb", "https://github.com/ecmwf/cfgrib"),
99104
"covjsonkit": ("covjsonkit", "https://github.com/ecmwf/covjsonkit"),
100105
"earthkit": ("earthkit", "https://earthkit.readthedocs.io/en/latest/"),
@@ -121,10 +126,14 @@
121126
),
122127
"odb": ("ODB", "https://odc.readthedocs.io/en/latest/content/introduction.html"),
123128
"pyodc": ("pyodc", "https://github.com/ecmwf/pyodc"),
129+
"s3cmd": ("s3cmd", "https://s3tools.org/s3cmd"),
124130
}
125131

126132

127-
intersphinx_mapping = {"pandas": ("https://pandas.pydata.org/docs/", None)}
133+
intersphinx_mapping = {
134+
"pandas": ("https://pandas.pydata.org/docs/", None),
135+
"xarray": ("https://docs.xarray.dev/en/latest/", None),
136+
}
128137

129138

130139
def setup(app):

docs/examples/NUTS_RG_20M_2021_3035.geojson

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

docs/examples/cache.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
24-
"import earthkit.data\n",
2524
"from earthkit.data import settings, cache"
2625
]
2726
},

docs/examples/data_from_stream.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@
164164
{
165165
"cell_type": "markdown",
166166
"id": "brilliant-struggle",
167-
"metadata": {},
167+
"metadata": {
168+
"editable": true,
169+
"slideshow": {
170+
"slide_type": ""
171+
},
172+
"tags": []
173+
},
168174
"source": [
169175
"Having finished the iteration there is no data available in *ds*. We can close the stream:"
170176
]
@@ -199,7 +205,7 @@
199205
"tags": []
200206
},
201207
"source": [
202-
"When we use the :py:meth:`batched <data.readers.grib.index.GribFieldList.batched>` method we can iterate throught the stream in batches of fixed size. In this example we create a stream and read 2 fields from it at a time."
208+
"When we use the :py:meth:`batched <data.readers.grib.index.GribFieldList.batched>` method we can iterate through the stream in batches of fixed size. In this example we create a stream and read 2 fields from it at a time."
203209
]
204210
},
205211
{

docs/examples/fdb.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"tags": []
8787
},
8888
"source": [
89-
"By default we retrieve data from FDB with :ref:`from_source() <data-sources-fdb>` as a stream."
89+
"By default we retrieve data from an :ref:`FDB <data-sources-fdb>` source with :ref:`from_source() <data-sources-fdb>` as a stream."
9090
]
9191
},
9292
{
@@ -1232,9 +1232,9 @@
12321232
],
12331233
"metadata": {
12341234
"kernelspec": {
1235-
"display_name": "pyfdb",
1235+
"display_name": "dev_ecc",
12361236
"language": "python",
1237-
"name": "pyfdb"
1237+
"name": "dev_ecc"
12381238
},
12391239
"language_info": {
12401240
"codemirror_mode": {
@@ -1246,7 +1246,7 @@
12461246
"name": "python",
12471247
"nbconvert_exporter": "python",
12481248
"pygments_lexer": "ipython3",
1249-
"version": "3.8.12"
1249+
"version": "3.10.13"
12501250
}
12511251
},
12521252
"nbformat": 4,

0 commit comments

Comments
 (0)