Skip to content

Commit ba86782

Browse files
merging
2 parents 61dd796 + 68d6a1a commit ba86782

19 files changed

Lines changed: 1452 additions & 116 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,16 @@ defaults:
1818

1919
jobs:
2020
unit-test:
21-
name: "py${{ matrix.python-version }} | ${{ matrix.os }} | unit tests (${{ matrix.test-subfolder }})"
21+
name: "py${{ matrix.python-version }} | ${{ matrix.os }} | unit tests"
2222
runs-on: ${{ matrix.os }}-latest
2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
os: [ubuntu] #, mac, windows] # TODO v4: Re-enable windows and mac
27-
test-subfolder: ["/"]
2827
python-version: ["3.12"]
2928
include:
3029
- os: ubuntu
3130
python-version: "3.11"
32-
test-subfolder: "/"
33-
- os: ubuntu
34-
python-version: "3.12"
35-
test-subfolder: "/v4"
3631
steps:
3732
- name: Checkout
3833
uses: actions/checkout@v4
@@ -43,7 +38,7 @@ jobs:
4338
python-version: ${{ matrix.python-version }}
4439
- name: Unit test
4540
run: |
46-
coverage run -m pytest -v -s --html=${{ matrix.os }}_${{ matrix.python-version }}_unit_test_report.html --self-contained-html tests${{ matrix.test-subfolder }}
41+
coverage run -m pytest -v -s --html=${{ matrix.os }}_${{ matrix.python-version }}_unit_test_report.html --self-contained-html
4742
coverage xml
4843
- name: Codecov
4944
uses: codecov/codecov-action@v5.3.1
@@ -58,6 +53,8 @@ jobs:
5853
name: Unittest report ${{ matrix.os }}-${{ matrix.python-version }}
5954
path: ${{ matrix.os }}_${{ matrix.python-version }}_unit_test_report.html
6055
integration-test:
56+
# TODO v4: Re-enable the workflow once development has stabilized and we want to run integration tests again
57+
if: false
6158
name: "py${{ matrix.python-version }} | ${{ matrix.os }} | integration tests"
6259
runs-on: ${{ matrix.os }}-latest
6360
strategy:
@@ -111,6 +108,8 @@ jobs:
111108
pattern: "* report *"
112109
typechecking:
113110
name: mypy
111+
# TODO v4: Enable typechecking again
112+
if: false
114113
runs-on: ubuntu-latest
115114
steps:
116115
- name: Checkout

parcels/_core/utils/time.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import cftime
77
import numpy as np
88

9-
T = TypeVar("T", datetime, cftime.datetime)
10-
119
if TYPE_CHECKING:
12-
from parcels._typing import DatetimeLike
10+
from parcels._typing import TimeLike
11+
12+
T = TypeVar("T", bound="TimeLike")
1313

1414

1515
class TimeInterval:
@@ -92,7 +92,7 @@ def is_compatible(
9292

9393

9494
def get_datetime_type_calendar(
95-
example_datetime: DatetimeLike,
95+
example_datetime: TimeLike,
9696
) -> tuple[type, str | None]:
9797
"""Get the type and calendar of a datetime object.
9898

parcels/_core/utils/unstructured.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
from collections.abc import Hashable
2-
31
DIM_TO_VERTICAL_LOCATION_MAP = {
42
"nz1": "center",
53
"nz": "face",
64
}
75

86

9-
def get_vertical_location_from_dims(dims: tuple[Hashable, ...]):
7+
def get_vertical_location_from_dims(dims: tuple[str, ...]):
108
"""
119
Determine the vertical location of the field based on the uxarray.UxDataArray object variables.
1210

parcels/_datasets/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This subpackage uses xarray to generate *idealised* structured and unstructured hydrodynamical datasets that are compatible with Parcels. The goals are three-fold:
55
6-
1. To provide users with documentation for the types of datasets they can expect Parcels to work with.
6+
1. To provide users with documentation for the types of datasets they can expect Parcels to work with. When reporting bugs, users can use these datasets to reproduce the bug they're experiencing (allowing developers to quickly troubleshoot the problem).
77
2. To supply our tutorials with hydrodynamical datasets.
88
3. To offer developers datasets for use in test cases.
99
@@ -36,8 +36,10 @@
3636
3737
This subpackage is broken down into structured and unstructured parts. Each of these have common submodules:
3838
39-
* ``circulation_model`` -> hardcoded datasets with the intention of mimicking datasets from a certain (ocean) circulation model
39+
* ``circulation_model`` -> hardcoded datasets with the intention of mimicking dataset structure from a certain (ocean) circulation model. If you'd like to see Parcel support a new model, please open an issue in our issue tracker.
40+
* exposes a dict ``datasets`` mapping dataset names to xarray datasets
4041
* ``generic`` -> hardcoded datasets that are generic, and not tied to a certain (ocean) circulation model. Instead these focus on the fundamental properties of the dataset
42+
* exposes a dict ``datasets`` mapping dataset names to xarray datasets
4143
* ``generated`` -> functions to generate datasets with varying properties
4244
* ``utils`` -> any utility functions necessary related to either generating or validating datasets
4345

0 commit comments

Comments
 (0)