Skip to content

Commit 0cf5b9a

Browse files
authored
Merge pull request #46 from axiom-data-science/use_pydantic
Major refactor to use pydantic to organize and manager configuration and validation
2 parents c1a3000 + 3107d8b commit 0cf5b9a

Some content is hidden

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

50 files changed

+5755
-3753
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
20-
python-version: ["3.9", "3.10", "3.11"]
20+
python-version: ["3.11"] #, "3.12", "3.13"] opendrift can't use >3.11 yet
2121
steps:
2222
- uses: actions/checkout@v4
2323
- name: Cache conda
@@ -51,8 +51,10 @@ jobs:
5151
create-args: >-
5252
python=${{ matrix.python-version }} --channel conda-forge
5353
environment-file: ci/environment-py${{ matrix.python-version }}.yml
54-
cache-environment: true
54+
cache-environment: true # https://github.com/mamba-org/setup-micromamba/issues/130#issuecomment-1746964394
55+
cache-downloads: true
5556
post-cleanup: 'all'
57+
# generate-run-shell: false # https://github.com/mamba-org/setup-micromamba/issues/130#issuecomment-1746964394
5658

5759
- name: Install package
5860
shell: bash -l {0}

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ repos:
4141
language_version: python3
4242

4343
- repo: https://github.com/pre-commit/mirrors-mypy
44-
rev: v0.982
44+
rev: v1.15.0
4545
hooks:
4646
- id: mypy
4747
additional_dependencies: [types-setuptools,types-PyYAML]
@@ -54,3 +54,4 @@ repos:
5454
- id: codespell
5555
args:
5656
- --quiet-level=2
57+
exclude: 'particle_tracking_manager/models/opendrift/enums.py'

ci/environment-py3.10.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

ci/environment-py3.11.yml

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,26 @@ channels:
44
dependencies:
55
- python=3.11
66
############## These will have to be adjusted to your specific project
7-
# - adios-db
8-
- appdirs
7+
- adios_db
98
- aiohttp
10-
- kerchunk
11-
- numpy
12-
# # opendrift reqs
13-
# - matplotlib>=3.5
14-
# - numpy>=1.17
15-
# - scipy>=1.6
16-
# - netcdf4<=1.6.1
17-
# - ffmpeg
18-
# - pyproj>=2.3
19-
# - libgdal>=3.1
20-
# - gdal>=3.1
21-
# - xarray
22-
# - dask
23-
# - cfgrib
24-
# - pygrib
25-
# - xhistogram
26-
# - requests
27-
# - pytest<8
28-
# - pytest-cov
29-
# - pytest-benchmark
30-
# - pytest-mpl
31-
# - cartopy>=0.20
32-
# - nc-time-axis
33-
# - geojson
34-
# - pynucos>=2.12
35-
# - isodate
36-
# - coloredlogs
37-
# - cmocean
38-
# - utm
39-
# - roaring-landmask>=0.7
40-
# - trajan>=0.1.3
41-
# - adios_db
42-
##
43-
- opendrift>=1.11.13
44-
- scipy
9+
- appdirs
10+
- fastparquet
11+
- jupyter
12+
- jupyterlab
13+
- kerchunk ==0.2.7
4514
- xarray
46-
# - xroms
15+
- numpy <=1.26.4 # req from opendrift
16+
- opendrift <=1.13.0
17+
- scipy
18+
- dask
19+
- netcdf4
20+
- pandas
21+
- pip
22+
- pydantic
23+
- requests
24+
- matplotlib
25+
- xroms
26+
- zarr
4727
##############
4828
- codecov
4929
- pytest-cov

ci/environment-py3.12.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: test_env_particle-tracking-manager
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.12
6+
############## These will have to be adjusted to your specific project
7+
- adios_db
8+
- aiohttp
9+
- appdirs
10+
- fastparquet
11+
- jupyter
12+
- jupyterlab
13+
- kerchunk ==0.2.7
14+
- xarray
15+
- numpy <=1.26.4 # req from opendrift
16+
- opendrift <=1.13.0
17+
- scipy
18+
- dask
19+
- netcdf4
20+
- pandas
21+
- pip
22+
- pydantic
23+
- requests
24+
- matplotlib
25+
- xroms
26+
- zarr
27+
##############
28+
- codecov
29+
- pytest-cov
30+
- coverage
31+
- pip
32+
- pytest
33+
# - pip:
34+
# - adios_db
35+
# - git+https://github.com/OpenDrift/opendrift
36+
# - git+https://github.com/fsspec/kerchunk
37+
# - xroms # can't be found on conda-forge for CI, but don't need since in runslow tests?

ci/environment-py3.13.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: test_env_particle-tracking-manager
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.13
6+
############## These will have to be adjusted to your specific project
7+
- adios_db
8+
- aiohttp
9+
- appdirs
10+
- fastparquet
11+
- jupyter
12+
- jupyterlab
13+
- kerchunk ==0.2.7
14+
- xarray
15+
- numpy <=1.26.4 # req from opendrift
16+
- opendrift <=1.13.0
17+
- scipy
18+
- dask
19+
- netcdf4
20+
- pandas
21+
- pip
22+
- pydantic
23+
- requests
24+
- matplotlib
25+
- xroms
26+
- zarr
27+
##############
28+
- codecov
29+
- pytest-cov
30+
- coverage
31+
- pip
32+
- pytest
33+
# - pip:
34+
# - adios_db
35+
# - git+https://github.com/OpenDrift/opendrift
36+
# - git+https://github.com/fsspec/kerchunk
37+
# - xroms # can't be found on conda-forge for CI, but don't need since in runslow tests?

ci/environment-py3.9.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

docs/api.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,26 @@ API
33

44
.. currentmodule:: particle_tracking_manager
55

6+
Main Modules
7+
------------
68

79
.. autosummary::
810
:toctree: generated/
911
:recursive:
1012

1113
the_manager
12-
models
14+
models.opendrift.opendrift
15+
16+
Configuration Classes
17+
---------------------
18+
19+
.. autosummary::
20+
:toctree: generated/
21+
:recursive:
22+
23+
config_the_manager
24+
models.opendrift.config_opendrift
25+
ocean_model_registry
26+
config_ocean_model
27+
config_logging
28+
config_misc

0 commit comments

Comments
 (0)