Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to improve compliance with the IOOS Compliance Checker (glide… #163

Closed
wants to merge 104 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
86ca298
Updates to improve compliance with the IOOS Compliance Checker (glide…
jr3cermak Mar 26, 2024
eff60ad
TST: add 3.9 back in
jklymak Apr 5, 2024
812e746
MNT: more time changes - seconds to nano
Apr 18, 2024
88e673c
ENH: make time Fill Value show up in NetCDF via encoding
jklymak Apr 26, 2024
f49bd2c
ENH: Fill Value
jklymak Apr 29, 2024
960eff1
FIX: time in profiles
May 20, 2024
9d3bf35
ENH: add startime
May 21, 2024
b8eda9e
FIX: make get_depth more robust to missing data
May 26, 2024
6c36973
FIX: make get_derived_eos_raw more robust to no locations
May 26, 2024
5ea2202
FIX: bad maxgap default
jklymak Jun 1, 2024
b2a31ae
Merge pull request #169 from jklymak/fix-maxgap
jklymak Jun 1, 2024
fc59e43
ENH: allow multiple deploymentyaml
Jul 4, 2024
4c0d225
Changed variable metadata to float
cassandra-elmer Jul 11, 2024
8f24fff
Changed variable metadata to float
cassandra-elmer Jul 11, 2024
fbd8ff6
Fix polars read_csv separator keyword
cassandra-elmer Jul 11, 2024
612bf83
Fix str method strptime format keyword
cassandra-elmer Jul 11, 2024
1278dfe
Fix polars with_columns (using keep_name)
cassandra-elmer Jul 11, 2024
f1989db
Fix polars with_columns (using name.keep)
cassandra-elmer Jul 11, 2024
3d08fcc
Revert variable metadata to string
cassandra-elmer Jul 11, 2024
8667ad2
Change variable metadata to float
cassandra-elmer Jul 11, 2024
c51a90f
Change variable metadata to float
cassandra-elmer Jul 11, 2024
dac8a7e
Revert variable metadata to string
cassandra-elmer Jul 11, 2024
3395475
Change variable metadata to float
cassandra-elmer Jul 11, 2024
6cf781b
Change variable metadata to float
cassandra-elmer Jul 11, 2024
fc81138
Change variable metadata to float
cassandra-elmer Jul 11, 2024
85c606b
Change variable metadata to float
cassandra-elmer Jul 11, 2024
fe171cc
Add back required variable attributes as empty
cassandra-elmer Jul 11, 2024
f918ada
Add back required variable attributes as empty
cassandra-elmer Jul 11, 2024
b041a86
Add back required variable attributes as empty
cassandra-elmer Jul 11, 2024
bb79a46
Add back required variable attributes as empty
cassandra-elmer Jul 11, 2024
cf09112
Change variable attr to float
cassandra-elmer Jul 11, 2024
70e1d0a
Change minimum density
cassandra-elmer Jul 11, 2024
a28b5de
Change minimum density
cassandra-elmer Jul 11, 2024
f7bcd91
Change minimum density
cassandra-elmer Jul 11, 2024
7f6af1a
Change minimum density
cassandra-elmer Jul 11, 2024
462f088
Change variable attrs to float
cassandra-elmer Jul 11, 2024
1d96c65
Change minimum density
cassandra-elmer Jul 11, 2024
d36f204
Change variable metadata to float
cassandra-elmer Jul 11, 2024
2e67254
Ensure Path variables are input to functions as str
cassandra-elmer Jul 11, 2024
bfae863
Revert unnecessary Path to str changes
cassandra-elmer Jul 12, 2024
3622ad1
Merge pull request #173 from cassandra-elmer/fix_tests
jklymak Jul 14, 2024
bb14fb8
TST: update slocum (#175)
jklymak Jul 14, 2024
3598c9d
FIX: fix NaN in u, v (#176)
jklymak Jul 14, 2024
beaf8b2
FIX: make times floatingpoint seconds, not integer seconds
jklymak Jul 17, 2024
11e6d62
Merge pull request #177 from jklymak/fix-times-again
jklymak Jul 17, 2024
1690dc1
FIX: time for profiles
jklymak Jul 18, 2024
9f92866
Merge pull request #178 from jklymak/fix-times-profiles
jklymak Jul 18, 2024
82f0550
standarise time encoding to seconds since 1970
callumrollo Jul 26, 2024
70746b5
Merge pull request #180 from voto-ocean-knowledge/dev
jklymak Jul 26, 2024
8165f4c
FIX: for CF compliance
jklymak Jul 26, 2024
24488ff
ENH: make more cf compliant
jklymak Jul 26, 2024
c0a62b7
TST: fix timeseries
jklymak Jul 26, 2024
96fb528
Merge pull request #181 from jklymak/fix-cf-cmpliance
jklymak Jul 26, 2024
45c4141
move to stable polars, pin numpy below 2
callumrollo Aug 6, 2024
26e2b1f
github expand test matrix and refresh cache
callumrollo Aug 6, 2024
e33ecd9
move tests to micromamba
callumrollo Aug 6, 2024
085b54f
REF: np.NaN >> np.nan. unpin numpy
callumrollo Aug 6, 2024
772e511
Merge pull request #183 from voto-ocean-knowledge/requirements
jklymak Aug 6, 2024
de3c8ca
Merge branch 'main' into ci-micromamba
callumrollo Aug 6, 2024
179b508
update checkout and codecov to recent supported versions
callumrollo Aug 6, 2024
b1a2614
Merge pull request #184 from voto-ocean-knowledge/ci-micromamba
jklymak Aug 7, 2024
13ea358
FIX: make mission number int32
Jul 28, 2024
4655a10
FIX: some more small things
Aug 8, 2024
06804a9
Merge pull request #185 from c-proof/fix-mission-number
jklymak Aug 8, 2024
16eface
ENH: add more log decodng variables
Aug 13, 2024
6469db8
Merge pull request #186 from c-proof/enh-more-log-decode
jklymak Aug 13, 2024
08057e8
ENH: slocum - don't find profile indices if profile_min_time or profi…
Aug 13, 2024
79cc246
Merge pull request #187 from c-proof/enh-skip-profiles
jklymak Aug 13, 2024
c268bc9
Check for pressure
Aug 31, 2024
d619dbf
FIX: yaml files: degrees to rad
jklymak Aug 31, 2024
8cee59c
TST: fix the tests
jklymak Aug 31, 2024
b94e3f7
Merge pull request #189 from jklymak/fix-rad-degrees
jklymak Aug 31, 2024
1a6c1d6
MNT: pypi workflow
jklymak Sep 22, 2024
b472c4f
Merge pull request #192 from jklymak/pypi-workflow
jklymak Sep 22, 2024
9eb9a71
DOC: minor change to test pypi workflow
jklymak Sep 22, 2024
87f76b7
Merge pull request #193 from jklymak/test-pypi
jklymak Sep 22, 2024
cca3d9a
DOC: minor change to test pypi workflow
jklymak Sep 22, 2024
581a8d5
Merge pull request #194 from jklymak/test-pypi
jklymak Sep 22, 2024
2a15a76
MNT: version change
jklymak Sep 22, 2024
8d16c75
Merge pull request #195 from jklymak/version-change
jklymak Sep 22, 2024
2095be5
MNT: version change
jklymak Sep 22, 2024
922ca9e
Merge pull request #196 from jklymak/fix-version
jklymak Sep 22, 2024
fa13af7
MNT
jklymak Sep 22, 2024
aa43c17
Merge pull request #197 from jklymak/fix-version2
jklymak Sep 22, 2024
5a3df36
DOC: fixes
jklymak Oct 28, 2024
ff8c8bb
Merge pull request #201 from jklymak/fix-example-data-link
jklymak Oct 28, 2024
581c766
DOC: RTD
jklymak Oct 28, 2024
d26e196
Merge pull request #202 from jklymak/fix-read-the-docs
jklymak Oct 28, 2024
b59783a
FIX
jklymak Oct 29, 2024
fe21486
Merge pull request #203 from jklymak/fix-read-the-docs
jklymak Oct 29, 2024
b17720f
FIX
jklymak Oct 29, 2024
5d218e2
Merge pull request #204 from jklymak/fix-read-the-docs
jklymak Oct 29, 2024
766d9b0
FIX
jklymak Oct 29, 2024
dff9bba
Merge pull request #205 from jklymak/fix-read-the-docs
jklymak Oct 29, 2024
c5246d5
DOC: small changes to slocum
jklymak Oct 29, 2024
2140610
Merge pull request #206 from jklymak/doc-slocum-fixes
jklymak Oct 29, 2024
93db2d5
DOC: small changes to slocum
jklymak Oct 29, 2024
11093c2
Merge pull request #207 from jklymak/doc-slocum-fixes
jklymak Oct 29, 2024
7ec1b8e
DOC: small changes to slocum
jklymak Oct 29, 2024
83fb120
Merge pull request #208 from jklymak/doc-slocum-fixes
jklymak Oct 29, 2024
04545f8
Updates
jr3cermak Nov 5, 2024
68323e8
Updates
jr3cermak Nov 8, 2024
f95f77f
Updates
jr3cermak Nov 23, 2024
f9d286d
Merge remote-tracking branch 'refs/remotes/origin/uwfardev' into uwfa…
jr3cermak Nov 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Publish Python 🐍 distribution 📦 to PyPI

on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyglider
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/pyglider

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
37 changes: 14 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,33 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
- uses: actions/checkout@v4
- name: mamba setup enviroment
uses: mamba-org/[email protected]
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{hashFiles('environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pyglider-test
environment-name: test-env
environment-file: tests/environment.yml
python-version: ${{ matrix.python-version }}
channel-priority: strict
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
create-args: >-
python=${{ matrix.python-version }}
- name: Conda info
shell: bash -l {0}
shell: micromamba-shell {0}
run: conda info; conda list
- name: install pyglider source
shell: bash -l {0}
shell: micromamba-shell {0}
run: which pip; pip install -e .
- name: Process seaexplorer
shell: bash -l {0}
shell: micromamba-shell {0}
run: which python; cd tests/example-data/example-seaexplorer; make clean-all; python process_deploymentRealTime.py
- name: Process slocum
shell: bash -l {0}
shell: micromamba-shell {0}
run: which python; cd tests/example-data/example-slocum; make clean-all; python process_deploymentRealTime.py
- name: Process seaexplorer-legato-flntu-arod-ad2cp
shell: bash -l {0}
shell: micromamba-shell {0}
run: which python; cd tests/example-data/example-seaexplorer-legato-flntu-arod-ad2cp; make clean-all; python process_deploymentRealTime.py
- name: Run tests
shell: bash -l {0}
shell: micromamba-shell {0}
run: which python; pytest --cov --cov-report xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
*.egg-info
__pycache__
_build
build
docs/pyglider
dist

*.png
.DS_Store
.DS_Store

# Ignore test items
tests/data/l0-profiles/
tests/data/realtime_rawnc/
tests/example-data/example-seaexplorer-raw/L0-timeseries-test-interp/
tests/example-data/example-seaexplorer-raw/L0-timeseries-test/
tests/example-data/example-seaexplorer-raw/delayed_rawnc/
tests/example-data/example-seaexplorer-raw/deploymentDelayedInterp.yml
tests/example-data/example-seaexplorer/L0-timeseries-test-interp/
tests/example-data/example-seaexplorer/L0-timeseries-test/
tests/example-data/example-seaexplorer/bad_timebase.yml
tests/example-data/example-seaexplorer/deploymentRealtimeInterp.yml
tests/example-data/example-seaexplorer/no_timebase.yml
tests/example-data/example-seaexplorer/realtime_rawnc/
tests/example-data/example-slocum/L0-profiles/
tests/example-data/example-slocum/L0-timeseries/
tests/example-data/report.json
50 changes: 40 additions & 10 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2
python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs

# Build documentation in the docs/ directory with Sphinx

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

python:
install:
- requirements: docs-requirements.txt
# Install our python package before building the docs
- method: pip
path: .

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
18 changes: 6 additions & 12 deletions docs/getting-started-slocum.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@

## Gather data

Slocum gliders have 4 types of files. For telemetry data there is `*.sbd` files for sensor data, and `*.tbd` for the glider's attitude and position data. These are called `*.dbd` and `*.ebd` respectively, when retrieved from the gliders' payload post deployment. These need to be made available in a single directory for `pyglider` to process.
Slocum gliders have 4 types of files. For telemetry data there are `*.tbd` files for sensor data, and `*.sbd` for the glider's attitude and position data. These are called `*.ebd` and `*.tbd` respectively, when retrieved from the gliders' payload post deployment. Modern gliders have compressed version of these, eg `*.tcd`, `*.scd` that *pyglider* should be able to parse. These data files need to be made available in a _single_ directory for *pyglider* to process. Note that on the glider they are often separated into `science/logs` and `flight/logs`.

Slocums also have a sensor cache file `*.cac`, all of which have randomized names. These are needed by the processing, and are usually stored in a separate cache directory.
Slocum gliders also have a sensor cache file `*.cac`, all of which have randomized names. These are needed by the processing, and are usually stored in a separate cache directory.

You can download and expand example data using `.get_example_data`:
You can download example data at <https://cproof.uvic.ca/pyglider-example-data/pyglider-example-data.zip> which will add a local directory `example-data` to your current directory.

```python
import pyglider.example_data as pexamp

pexamp.get_example_data('./')
```

which will add a local directory `example-data` to your current directory.

## Make a deployment configuration file

Expand All @@ -33,8 +26,9 @@ The example script is relatively straight forward if there is no intermediate pr

Data comes from an input directory, and is translated into a single CF-compliant netCDF timeseries file using the package [dbdreader](https://dbdreader.readthedocs.io/en/latest/). Finally individual profiles are saved and a 2-D 1-m grid in time-depth is saved.

```{note} There is a version that does not require `dbdreader` to do the initial conversion from the Dinkum format to netCDF. However it is quite slow, particularly for full-resolution datasets, and less robust. We suggest using the `slocum.raw_to_timeseries`.
```
:::{note}
There is a version that does not require `dbdreader` to do the initial conversion from the Dinkum format to netCDF. However it is quite slow, particularly for full-resolution datasets, and less robust. We suggest using the `slocum.raw_to_timeseries`.
:::

It is possible that between these steps the user will want to add any screening steps, or adjustments to the calibrations. PyGlider does not provide those steps, but is designed so they are easy to add.

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ dependencies:
- dask
- netcdf4
- gsw
- polars>=1.1
- scipy
- bitstring
- pooch
- pip:
- dbdreader
- polars
2 changes: 1 addition & 1 deletion pyglider/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.4'
__version__ = '0.0.7'
Loading