Skip to content

Commit 7070404

Browse files
authored
Merge pull request #96 from kthyng/featuretypes
controlled selections for em.select
2 parents 3193646 + 7c05abf commit 7070404

21 files changed

+857
-48
lines changed

.github/workflows/test.yaml

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,80 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
12-
python-version: ["3.8", "3.9", "3.10"]
12+
python-version: ["3.9", "3.10", "3.11"]
1313
steps:
1414
- name: Checkout source
1515
uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Cache Linux/macOS (x86) Conda environment
20-
if: ${{ runner.os != 'Windows' }}
21-
uses: actions/cache@v3
22-
env:
23-
# Increase this value to reset cache if ci/environment.yml has not changed
24-
CACHE_NUMBER: 0
25-
with:
26-
path: ~/conda_pkgs_dir
27-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }}
19+
# - name: Cache Linux/macOS (x86) Conda environment
20+
# if: ${{ runner.os != 'Windows' }}
21+
# uses: actions/cache@v3
22+
# env:
23+
# # Increase this value to reset cache if ci/environment.yml has not changed
24+
# CACHE_NUMBER: 0
25+
# with:
26+
# path: ~/conda_pkgs_dir
27+
# key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }}
2828

29-
- name: Cache Windows Conda environment
30-
if: ${{ runner.os == 'Windows' }}
31-
uses: actions/cache@v3
32-
env:
33-
# Increase this value to reset cache if ci/environment.yml has not changed
34-
CACHE_NUMBER: 0
35-
with:
36-
path: ~/conda_pkgs_dir
37-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}-win.yml') }}
29+
# - name: Cache Windows Conda environment
30+
# if: ${{ runner.os == 'Windows' }}
31+
# uses: actions/cache@v3
32+
# env:
33+
# # Increase this value to reset cache if ci/environment.yml has not changed
34+
# CACHE_NUMBER: 0
35+
# with:
36+
# path: ~/conda_pkgs_dir
37+
# key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}-win.yml') }}
3838

39-
- name: Build and activate Linux/macOS Conda environment
39+
- name: Setup Linux/macOS Micromamba Python ${{ matrix.python-version }}
4040
if: ${{ runner.os != 'Windows' }}
41-
uses: conda-incubator/setup-miniconda@v2
41+
uses: mamba-org/setup-micromamba@v1
4242
with:
43-
miniforge-variant: Mambaforge
44-
python-version: ${{ matrix.python-version }}
45-
channels: conda-forge, defaults # These need to be specified to use mamba
46-
channel-priority: true
43+
init-shell: bash
44+
create-args: >-
45+
python=${{ matrix.python-version }} --channel conda-forge
4746
environment-file: ci/environment-py${{ matrix.python-version }}.yml
47+
cache-environment: true
48+
post-cleanup: 'all'
4849

49-
activate-environment: test-env-mac-unix
50-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
51-
52-
- name: Build and activate Windows Conda environment
50+
- name: Setup Windows Micromamba Python ${{ matrix.python-version }}
5351
if: ${{ runner.os == 'Windows' }}
54-
uses: conda-incubator/setup-miniconda@v2
52+
uses: mamba-org/setup-micromamba@v1
5553
with:
56-
miniforge-variant: Mambaforge
57-
python-version: ${{ matrix.python-version }}
58-
channels: conda-forge, defaults # These need to be specified to use mamba
59-
channel-priority: true
54+
init-shell: bash
55+
create-args: >-
56+
python=${{ matrix.python-version }} --channel conda-forge
6057
environment-file: ci/environment-py${{ matrix.python-version }}-win.yml
58+
cache-environment: true
59+
post-cleanup: 'all'
60+
61+
# - name: Build and activate Linux/macOS Conda environment
62+
# if: ${{ runner.os != 'Windows' }}
63+
# uses: conda-incubator/setup-miniconda@v2
64+
# with:
65+
# miniforge-variant: Mambaforge
66+
# python-version: ${{ matrix.python-version }}
67+
# channels: conda-forge, defaults # These need to be specified to use mamba
68+
# channel-priority: true
69+
# environment-file: ci/environment-py${{ matrix.python-version }}.yml
70+
71+
# activate-environment: test-env-mac-unix
72+
# use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
73+
74+
# - name: Build and activate Windows Conda environment
75+
# if: ${{ runner.os == 'Windows' }}
76+
# uses: conda-incubator/setup-miniconda@v2
77+
# with:
78+
# miniforge-variant: Mambaforge
79+
# python-version: ${{ matrix.python-version }}
80+
# channels: conda-forge, defaults # These need to be specified to use mamba
81+
# channel-priority: true
82+
# environment-file: ci/environment-py${{ matrix.python-version }}-win.yml
6183

62-
activate-environment: test-env-win
63-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
84+
# activate-environment: test-env-win
85+
# use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
6486

6587
- name: Install package in environment
6688
shell: bash -l {0}

ci/environment-py3.10-win.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ dependencies:
1212
- scikit-learn # used by xoak for tree
1313
- xarray
1414
- xoak
15+
# - xroms
1516
- pytest
1617
- pytest-benchmark
1718
- pip:
19+
- xroms >=0.5.3
1820
- codecov
1921
- pytest-cov
2022
- coverage[toml]

ci/environment-py3.10.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- python=3.10
66
- cf_xarray>=0.6
7-
- dask <=2022.05.0 # for xESMF, https://github.com/axiom-data-science/extract_model/issues/49
7+
- dask
88
- netcdf4
99
- numpy <1.24 # https://github.com/numba/numba/issues/8615#issuecomment-1360792615
1010
- pip
@@ -13,9 +13,11 @@ dependencies:
1313
- xarray
1414
- xesmf
1515
- xoak
16+
# - xroms
1617
- pytest
1718
- pytest-benchmark
1819
- pip:
20+
- xroms >=0.5.3
1921
- codecov
2022
- pytest-cov
2123
- coverage[toml]

ci/environment-py3.8-win.yml renamed to ci/environment-py3.11-win.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: test-env-win
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.8
5+
- python=3.11
66
- cf_xarray>=0.6
77
- dask
88
- netcdf4
@@ -12,9 +12,11 @@ dependencies:
1212
- scikit-learn # used by xoak for tree
1313
- xarray
1414
- xoak
15+
# - xroms
1516
- pytest
1617
- pytest-benchmark
1718
- pip:
19+
- xroms >=0.5.3
1820
- codecov
1921
- pytest-cov
2022
- coverage[toml]

ci/environment-py3.8.yml renamed to ci/environment-py3.11.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: test-env-mac-unix
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.8
5+
- python=3.11
66
- cf_xarray>=0.6
7-
- dask <=2022.05.0 # for xESMF, https://github.com/axiom-data-science/extract_model/issues/49
7+
- dask
88
- netcdf4
99
- numpy <1.24 # https://github.com/numba/numba/issues/8615#issuecomment-1360792615
1010
- pip
@@ -13,9 +13,11 @@ dependencies:
1313
- xarray
1414
- xesmf
1515
- xoak
16+
# - xroms
1617
- pytest
1718
- pytest-benchmark
1819
- pip:
20+
- xroms >=0.5.3
1921
- codecov
2022
- pytest-cov
2123
- coverage[toml]

ci/environment-py3.9-win.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ dependencies:
1212
- scikit-learn # used by xoak for tree
1313
- xarray
1414
- xoak
15+
# - xroms
1516
- pytest
1617
- pytest-benchmark
1718
- pip:
19+
- xroms >=0.5.3
1820
- codecov
1921
- pytest-cov
2022
- coverage[toml]

ci/environment-py3.9.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
dependencies:
55
- python=3.9
66
- cf_xarray>=0.6
7-
- dask <=2022.05.0 # for xESMF, https://github.com/axiom-data-science/extract_model/issues/49
7+
- dask
88
- netcdf4
99
- numpy <1.24 # https://github.com/numba/numba/issues/8615#issuecomment-1360792615
1010
- pip
@@ -13,9 +13,11 @@ dependencies:
1313
- xarray
1414
- xesmf
1515
- xoak
16+
# - xroms
1617
- pytest
1718
- pytest-benchmark
1819
- pip:
20+
- xroms >=0.5.3
1921
- codecov
2022
- pytest-cov
2123
- coverage[toml]

docs/featuretypes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Feature types
2+
3+
Feature types are defined by NCEI and provide structure types of data to expect. More information is available [in general](https://www.ncei.noaa.gov/netcdf-templates) and for the current [NCEI NetCDF Templates 2.0](https://www.ncei.noaa.gov/data/oceans/ncei/formats/netcdf/v2.0/index.html). The following information may be useful for thinking about this. In particular, you select `locstream`, `locstreamT`, and `locstreamZ` as a user for `em.select()` and this table can guide how to select.
4+
5+
| | timeSeries | profile | timeSeriesProfile | trajectory (TODO) | trajectoryProfile | grid (TODO) |
6+
|--- |--- |--- |--- |--- | --- | --- |
7+
| Definition | only t changes | only z changes | t and z change | t, y, and x change | t, z, y, and x change | t changes, y/x grid |
8+
| Data types | mooring, buoy | CTD profile | moored ADCP | flow through, 2D drifter | glider, transect of CTD profiles, towed ADCP, 3D drifter | satellite, HF Radar |
9+
| Model extraction | time series at surface or depth | | vertical cross section | 2D drifters | 3D drifters | regridding, x/y slice in depth |
10+
| X/Y are pairs ("locstream") or grid | either locstream or grid | either locstream or grid | either locstream or grid | locstream | locstream | grid |
11+
| Which dimensions are independent from X/Y choice? |
12+
| T | Independent | Independent | Independent | locstreamT | locstreamT | Independent |
13+
| Z | Independent | Independent | Independent | Independent | locstreamZ | Independent |

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ To install from PyPI:
2424
:hidden:
2525
:caption: Examples and demos
2626

27+
featuretypes.md
2728
models.ipynb
2829
unstructured_subsetting.ipynb
2930
ts_work.ipynb

docs/whats_new.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
:mod:`What's New`
22
-----------------
33

4-
v1.2.2 (October 4, 2023)
4+
v1.3.0 (October 11, 2023)
5+
=========================
6+
* Incorporated `locstreamT` and `locstreamZ` to standardize the options available to user in `em.select()`.
7+
* added more tests by featuretype to cover more area
8+
9+
v1.2.2 (October 5, 2023)
510
========================
611
* Improved the processing of ROMS model output
712

0 commit comments

Comments
 (0)