Skip to content

Commit 11e831c

Browse files
committed
Merge commit '1815e4f8cebccab7c6be31f31a6b1e0d96b5a016'
2 parents 2430f87 + 1815e4f commit 11e831c

46 files changed

Lines changed: 511 additions & 523 deletions

Some content is hidden

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

.github/PULL_REQUEST_TEMPLATE/release-patch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ What to do to actually release:
2929
What to do after a release:
3030

3131
- [ ] update the pace PR from the pre-commit checklist to include the released version of NDSL and merge it.
32-
- [ ] in NDSL, merge `main` back into `develop` (potentially adding a commit to fix the issue "properly")
32+
- [ ] in NDSL, merge `main` back into `develop` (potentially adding a commit to fix the issue "properly") to have all changes in develop and ensure `setuptools_scm` finds the latest release tag

.github/PULL_REQUEST_TEMPLATE/release.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ What to do to actually release:
2222

2323
What to do after a release:
2424

25+
- [ ] merge `main` down into `develop` to ensure `setuptools_scm` finds the latest release tag
2526
- [ ] update the pace PR from the pre-commit checklist to include the released version of NDSL and merge it.
2627
- [ ] merge breaking changes in NDSL (e.g. search for deprecation warnings)

.github/workflows/fv3_translate_tests.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ on:
1010

1111
jobs:
1212
fv3_translate_tests:
13-
# TODO
14-
# restore once NDSL 2026.02.00 is released and pyFV3 is updated.
15-
# uses: NOAA-GFDL/pyFV3/.github/workflows/translate.yaml@develop
16-
uses: romanc/pyFV3/.github/workflows/translate.yaml@noop
13+
uses: twicki/pyFV3/.github/workflows/translate.yaml@update/numpy_2x
1714
with:
1815
component_trigger: true
1916
component_name: NDSL

.github/workflows/pace_tests.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ on:
1010

1111
jobs:
1212
pace_main_tests:
13-
# TODO
14-
# restore once NDSL 2026.02.00 is released and pace is updated.
15-
# uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop
16-
uses: romanc/pace/.github/workflows/main_unit_tests.yaml@noop
13+
uses: floriandeconinck/pace/.github/workflows/main_unit_tests.yaml@update/numpy_2x
1714
with:
1815
component_trigger: true
1916
component_name: NDSL

.github/workflows/shield_tests.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ on:
1010

1111
jobs:
1212
shield_translate_tests:
13-
# TODO
14-
# restore once NDSL 2026.02.00 is released and pySHiELD is updated.
15-
# uses: NOAA-GFDL/pySHiELD/.github/workflows/translate.yaml@develop
16-
uses: romanc/pySHiELD/.github/workflows/translate.yaml@noop
13+
uses: floriandeconinck/pySHiELD/.github/workflows/translate.yaml@update/numpy_2x
1714
with:
1815
component_trigger: true
1916
component_name: NDSL

.github/workflows/unit_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: ['3.11', '3.12']
21+
python-version: ['3.11', '3.12', '3.13']
2222
name: Python ${{ matrix.python-version }}
2323
steps:
2424
- name: Checkout repository

examples/NDSL/03_orchestration_basics.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
" orchestrate,\n",
3636
" QuantityFactory,\n",
3737
")\n",
38-
"from ndsl.constants import X_DIM, Y_DIM, Z_DIM\n",
38+
"from ndsl.constants import I_DIM, J_DIM, K_DIM\n",
3939
"from ndsl.dsl.typing import FloatField, Float\n",
4040
"from ndsl.boilerplate import get_factories_single_tile_orchestrated"
4141
]
@@ -93,7 +93,7 @@
9393
" domain=grid_indexing.domain_compute(),\n",
9494
" )\n",
9595
" self._tmp_field = quantity_factory.zeros(\n",
96-
" [X_DIM, Y_DIM, Z_DIM], \"n/a\", dtype=dtype\n",
96+
" [I_DIM, J_DIM, K_DIM], \"n/a\", dtype=dtype\n",
9797
" )\n",
9898
" self._n_halo = quantity_factory.sizer.n_halo\n",
9999
"\n",
@@ -134,9 +134,9 @@
134134
" )\n",
135135
" local_sum = LocalSum(stencil_factory, qty_factory)\n",
136136
"\n",
137-
" in_field = qty_factory.zeros([X_DIM, Y_DIM, Z_DIM], \"n/a\", dtype=dtype)\n",
137+
" in_field = qty_factory.zeros([I_DIM, J_DIM, K_DIM], \"n/a\", dtype=dtype)\n",
138138
" in_field.view[:] = 2.0\n",
139-
" out_field = qty_factory.zeros([X_DIM, Y_DIM, Z_DIM], \"n/a\", dtype=dtype)\n",
139+
" out_field = qty_factory.zeros([I_DIM, J_DIM, K_DIM], \"n/a\", dtype=dtype)\n",
140140
"\n",
141141
" # Run\n",
142142
" local_sum(in_field, out_field)"

external/gt4py

Submodule gt4py updated 120 files

ndsl/buffer.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
import contextlib
44
from collections.abc import Callable, Generator, Iterable
5+
from typing import Any
56

67
import numpy as np
7-
from numpy.lib.index_tricks import IndexExpression
8+
import numpy.typing as npt
89

910
from ndsl.performance.timer import NullTimer, Timer
1011
from ndsl.types import Allocator
@@ -16,7 +17,7 @@
1617
)
1718

1819

19-
BufferKey = tuple[Callable, Iterable[int], type]
20+
BufferKey = tuple[Callable, Iterable[int], npt.DTypeLike]
2021
BUFFER_CACHE: dict[BufferKey, list["Buffer"]] = {}
2122

2223

@@ -41,7 +42,7 @@ def __init__(self, key: BufferKey, array: np.ndarray):
4142

4243
@classmethod
4344
def pop_from_cache(
44-
cls, allocator: Allocator, shape: Iterable[int], dtype: type
45+
cls, allocator: Allocator, shape: Iterable[int], dtype: npt.DTypeLike
4546
) -> Buffer:
4647
"""Retrieve or insert then retrieve of buffer from cache.
4748
@@ -78,8 +79,8 @@ def finalize_memory_transfer(self) -> None:
7879
def assign_to(
7980
self,
8081
destination_array: np.ndarray,
81-
buffer_slice: IndexExpression = np.index_exp[:],
82-
buffer_reshape: IndexExpression = None,
82+
buffer_slice: Any = np.index_exp[:],
83+
buffer_reshape: Any | None = None,
8384
) -> None:
8485
"""Assign internal array to destination_array.
8586
@@ -95,7 +96,7 @@ def assign_to(
9596
)
9697

9798
def assign_from(
98-
self, source_array: np.ndarray, buffer_slice: IndexExpression = np.index_exp[:]
99+
self, source_array: np.ndarray, buffer_slice: Any = np.index_exp[:]
99100
) -> None:
100101
"""Assign source_array to internal array.
101102
@@ -107,7 +108,7 @@ def assign_from(
107108

108109
@contextlib.contextmanager
109110
def array_buffer(
110-
allocator: Allocator, shape: Iterable[int], dtype: type
111+
allocator: Allocator, shape: Iterable[int], dtype: npt.DTypeLike
111112
) -> Generator[Buffer, Buffer, None]:
112113
"""
113114
A context manager providing a contiguous array, which may be re-used between calls.
@@ -132,7 +133,7 @@ def send_buffer(
132133
allocator: Callable,
133134
array: np.ndarray,
134135
timer: Timer | None = None,
135-
) -> np.ndarray:
136+
) -> Generator[np.ndarray]:
136137
"""A context manager ensuring that `array` is contiguous in a context where it is
137138
being sent as data, copying into a recycled buffer array if necessary.
138139
@@ -166,7 +167,7 @@ def recv_buffer(
166167
allocator: Callable,
167168
array: np.ndarray,
168169
timer: Timer | None = None,
169-
) -> np.ndarray:
170+
) -> Generator[np.ndarray]:
170171
"""A context manager ensuring that array is contiguous in a context where it is
171172
being used to receive data, using a recycled buffer array and then copying the
172173
result into array if necessary.

0 commit comments

Comments
 (0)