Skip to content

Commit 0bb6208

Browse files
Merge branch 'v4-dev' into convert_from_copernicusmarine
2 parents fdceaed + 977d926 commit 0bb6208

17 files changed

Lines changed: 36 additions & 47 deletions

File tree

.github/workflows/cache-pixi-lock.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,41 @@ on:
1212

1313
jobs:
1414
cache-pixi-lock:
15-
name: Generate output
15+
name: Pixi lock
1616
runs-on: ubuntu-latest
1717
outputs:
1818
cache-id: ${{ steps.restore.outputs.cache-primary-key }}
1919
steps:
20-
- uses: actions/checkout@v5
20+
- uses: actions/checkout@v6
2121
with:
2222
fetch-depth: 0
2323
submodules: recursive
2424
- name: Get current date
2525
id: date
2626
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
27-
- uses: actions/cache/restore@v4
27+
- uses: actions/cache/restore@v5
2828
id: restore
2929
with:
3030
path: |
3131
pixi.lock
32-
key: ${{ steps.date.outputs.date }}_${{inputs.pixi-version}}_${{hashFiles('pixi.toml')}}
33-
- uses: prefix-dev/setup-pixi@v0.9.0
32+
key: ${{ steps.date.outputs.date }}_${{ inputs.pixi-version }}_${{hashFiles('pixi.toml')}}
33+
- uses: prefix-dev/setup-pixi@v0.9.3
3434
if: ${{ !steps.restore.outputs.cache-hit }}
3535
with:
3636
pixi-version: ${{ inputs.pixi-version }}
3737
run-install: false
3838
- name: Run pixi lock
3939
if: ${{ !steps.restore.outputs.cache-hit }}
4040
run: pixi lock
41-
- uses: actions/cache/save@v4
41+
- uses: actions/cache/save@v5
4242
if: ${{ !steps.restore.outputs.cache-hit }}
4343
id: cache
4444
with:
4545
path: |
4646
pixi.lock
4747
key: ${{ steps.restore.outputs.cache-primary-key }}
4848
- name: Upload pixi.lock
49-
uses: actions/upload-artifact@v5
49+
uses: actions/upload-artifact@v6
5050
with:
5151
name: pixi-lock
5252
path: pixi.lock

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ defaults:
1616
run:
1717
shell: bash -el {0}
1818

19+
env:
20+
PIXI_VERSION: "v0.63.0"
21+
1922
jobs:
2023
cache-pixi-lock:
2124
uses: ./.github/workflows/cache-pixi-lock.yml
25+
with:
26+
pixi-version: "v0.62.2" # keep in sync with env var above
2227
unit-test:
2328
name: "Unit tests: ${{ matrix.os }} | pixi run -e ${{ matrix.pixi-environment }} tests"
2429
runs-on: ${{ matrix.os }}-latest
@@ -49,6 +54,7 @@ jobs:
4954
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
5055
- uses: prefix-dev/setup-pixi@v0.9.0
5156
with:
57+
pixi-version: ${{ env.PIXI_VERSION }}
5258
cache: true
5359
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
5460
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
@@ -112,6 +118,7 @@ jobs:
112118
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
113119
- uses: prefix-dev/setup-pixi@v0.9.0
114120
with:
121+
pixi-version: ${{ env.PIXI_VERSION }}
115122
cache: true
116123
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
117124
- name: Integration test
@@ -159,6 +166,7 @@ jobs:
159166
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
160167
- uses: prefix-dev/setup-pixi@v0.9.0
161168
with:
169+
pixi-version: ${{ env.PIXI_VERSION }}
162170
cache: true
163171
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'v4-dev' }} # TODO: Update v4-dev to main when v4 is released
164172
- name: Typechecking

docs/getting_started/explanation_concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ We have to be careful with writing kernels for vector fields on Curvilinear grid
164164
- [Sample fields like temperature](../user_guide/examples/tutorial_sampling.ipynb).
165165
- [Mimic the behaviour of ARGO floats](../user_guide/examples/tutorial_Argofloats.ipynb).
166166
- [Add diffusion to approximate subgrid-scale processes and unresolved physics](../user_guide/examples/tutorial_diffusion.ipynb).
167-
- [Convert between units in m/s and degrees](../user_guide/examples/tutorial_unitconverters.ipynb).
167+
- [Convert velocities between units in m s<sup>-1</sup> and degrees s<sup>-1</sup>](../user_guide/examples/tutorial_velocityconversion.ipynb).
168168
```
169169

170170
## 4. Execute

docs/user_guide/examples_v3/tutorial_nemo_3D.ipynb renamed to docs/user_guide/examples/tutorial_nemo_3D.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"cell_type": "markdown",
66
"metadata": {},
77
"source": [
8-
"# Nemo 3D tutorial\n"
8+
"# 🖥️ Nemo 3D tutorial\n"
99
]
1010
},
1111
{

docs/user_guide/examples/tutorial_unitconverters.ipynb renamed to docs/user_guide/examples/tutorial_velocityconversion.ipynb

File renamed without changes.

docs/user_guide/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ The tutorials written for Parcels v3 are currently being updated for Parcels v4.
2626
:titlesonly:
2727
examples/explanation_grids.md
2828
examples/tutorial_nemo_curvilinear.ipynb
29-
examples_v3/tutorial_nemo_3D.ipynb # TODO move to examples folder
30-
examples/tutorial_unitconverters.ipynb
29+
examples/tutorial_nemo_3D.ipynb
30+
examples/tutorial_velocityconversion.ipynb
3131
examples/tutorial_nestedgrids.ipynb
3232
```
3333

pixi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ version = "dynamic" # dynamic versioning needs better support in pixi https://gi
1010
license = "MIT" # can remove this once https://github.com/prefix-dev/pixi-build-backends/issues/397 is resolved
1111

1212
[package.build]
13-
backend = { name = "pixi-build-python", version = "==0.4.0" }
13+
backend = { name = "pixi-build-python", version = "0.4.*" }
1414

1515
[package.host-dependencies]
1616
setuptools = "*"

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ select = [
8787
"T100", # Checks for the presence of debugger calls and imports
8888
"N", # pep8 naming conventions
8989
"PGH004", # ensures no blanket noqa's are used
90+
"W", # Pycodestyle warnings
91+
"YTT", # checks for misuse of sys.version or sys.version_info
92+
# "FBT", # checks for boolean traps (which result in poor function API)
93+
# "A", # check for python builtins being used as variables or parameters
94+
# "T20", # disallows printing in code - parcels source code should not have dev debugging statements, or should use logging statements instead of prints
95+
"NPY201", # numpy 2 deprecations
9096
]
9197

9298
exclude = [
@@ -95,6 +101,7 @@ exclude = [
95101
] # TODO v4: Remove once folders are gone
96102

97103
ignore = [
104+
# # Rules intentionally excluded
98105
# line too long (82 > 79 characters)
99106
"E501",
100107
# ‘from module import *’ used; unable to detect undefined names
@@ -109,7 +116,6 @@ ignore = [
109116
"UP038",
110117
# Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
111118
"RUF043",
112-
"RUF046", # Value being cast to `int` is already an integer
113119

114120
# Parcels specific deviations from PEP8 naming
115121
'N802', # We use function names that are camelcased to denote functions
@@ -118,10 +124,7 @@ ignore = [
118124
'N816', # TODO: Enable for `src` and consider disabling for notebooks
119125
'N818', # Not all Parcels exceptions should have an "Error" suffix
120126

121-
# TODO: Move this ignore so that it only applies in the tests folder. Do in conjunction with any doc related rules
122-
"RUF059", # Unpacked variable `coords` is never used
123-
124-
# TODO: ignore for now (requires more work). Remove ignore once fixed
127+
# # TODO: ignore for now (requires more work). Remove ignore once fixed
125128
# Missing docstring in public module
126129
"D100",
127130
# Missing docstring in public package
@@ -136,7 +139,6 @@ ignore = [
136139
"D404",
137140
# 1 blank line required between summary line and description (requires writing of summaries)
138141
"D205",
139-
"F811",
140142
]
141143

142144
[tool.ruff.lint.per-file-ignores]

src/parcels/_core/fieldset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def add_constant_field(self, name: str, value, mesh: Mesh = "spherical"):
136136
Value of the constant field
137137
mesh : str
138138
String indicating the type of mesh coordinates,
139-
see also `this tutorial <../examples/tutorial_unitconverters.ipynb>`__:
140139
141140
1. spherical (default): Lat and lon in degree, with a
142141
correction for zonal velocity U near the poles.

src/parcels/_datasets/structured/generated.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
_attach_sgrid_metadata,
1111
)
1212
from parcels._core.utils.time import timedelta_to_float
13-
from parcels._datasets.utils import _attach_sgrid_metadata
1413

1514

1615
def simple_UV_dataset(dims=(360, 2, 30, 4), maxdepth=1, mesh="spherical"):

0 commit comments

Comments
 (0)