Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 0 additions & 31 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Follow the instructions in our [contributing page](./contributing.md).
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
37 changes: 22 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
name: Test pyglider
on: [push, pull_request]

defaults:
run:
shell: bash -el {0}

jobs:
test-gliders:
name: pyglider (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: mamba setup enviroment
uses: mamba-org/[email protected]
with:
environment-name: test-env
environment-file: tests/environment.yml
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
- name: Conda info
shell: micromamba-shell {0}
run: conda info; conda list
- name: install pyglider source
shell: micromamba-shell {0}
run: which pip; pip install -e .
run: |
pip install -e .
- name: Process seaexplorer
shell: micromamba-shell {0}
run: which python; cd tests/example-data/example-seaexplorer; make clean-all; python process_deploymentRealTime.py
run: |
cd tests/example-data/example-seaexplorer
make clean-all
python process_deploymentRealTime.py
- name: Process slocum
shell: micromamba-shell {0}
run: which python; cd tests/example-data/example-slocum; make clean-all; python process_deploymentRealTime.py
run: |
cd tests/example-data/example-slocum
make clean-all
python process_deploymentRealTime.py
- name: Process seaexplorer-legato-flntu-arod-ad2cp
shell: micromamba-shell {0}
run: which python; cd tests/example-data/example-seaexplorer-legato-flntu-arod-ad2cp; make clean-all; python process_deploymentRealTime.py
run: |
cd tests/example-data/example-seaexplorer-legato-flntu-arod-ad2cp
make clean-all
python process_deploymentRealTime.py
- name: Run tests
shell: micromamba-shell {0}
run: which python; pytest --cov --cov-report xml
run: pytest --cov --cov-report xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
36 changes: 3 additions & 33 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,11 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# 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"
python: mambaforge-22.9

# Build documentation in the "docs/" directory with Sphinx
sphinx:
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
conda:
environment: environment.yml
16 changes: 0 additions & 16 deletions docs-requirements.txt

This file was deleted.

12 changes: 1 addition & 11 deletions docs/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,4 @@ conda install -c conda-forge pyglider

## Editable installation

If you want to be able to edit the files in `pyglider/pyglider` then install
the dependencies as above. Fork of PyGlider on github, and then clone it locally:

```
git clone https://github.com/yourname/pyglider.git
```

Navigate to the new `pyglider` directory and then do `pip install -e .`.
That will re-install pyglider with links to the local directory, so you
can edit the library files. If you do so, consider making a pull-request
with your changes!
Follow the instructions in our [contributing page](./contributing.md).
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
# The full version, including alpha/beta/rc tags
release = __version__


master_doc = 'index'
source_suffix = ['.rst', '.md']
# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
Expand All @@ -36,7 +37,7 @@
'myst_parser',
'sphinx.ext.autodoc',
'sphinx.ext.inheritance_diagram',
'autoapi.sphinx',
'autoapi.extension',
]

extensions.append('sphinx.ext.intersphinx')
Expand All @@ -46,7 +47,7 @@
'python': ('https://docs.python.org/3/', None),
}

autoapi_modules = {'pyglider': None}
autoapi_dirs = ['../pyglider']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
57 changes: 57 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Contributing

## Create a fork

```{note}
TODO: Create contributing page noting:
- the forking process (trimmed down)
```

## Development environment

Assuming that you have Anaconda/Miniconda installed, you can create a new environment for development:

```bash
conda create -n pyglider-dev python=3.9
conda activate pyglider-dev
```

Then install the dependencies:

```bash
conda env update -f environment.yml -n pyglider-dev
```

And install the package in editable mode:

```bash
pip install -e . --no-build-isolation --no-deps
```

Done!

---

From here, you can make the changes you want, and add tests. When you are ready, you can create a pull request into the codebase.

## Running tests

Once the development environment is set up, you can run the tests with:

```bash
pytest
```

## Building documentation

```{note}
TODO
```

## [Optional] Running pre-commit

We use pre-commit [TODO link] to run tooling on the code to make sure that it adheres to standards that we have adopted in the codebase. This is done automatically in the cloud on all pull requests, however this can also be done locally.

Pre-commit is already a dependency in the `environment.yml` file, so you only have to do `pre-commit install` in the repository (this will install the hooks in the repository so that they run when you commit changes).

That's it! If you want to, you can manually run the hooks by doing `pre-commit run --all-files` (or `pre-commit run` if you only want to run on staged files).
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Install
getting-started-seaexplorer
getting-started-slocum
pyglider/pyglider
contributing

```

Expand Down
24 changes: 22 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: pyglider
name: pyglider-dev
channels:
- conda-forge
dependencies:
- python>=3.10
# Core
- python>=3.9
- numpy
- pip
- xarray
Expand All @@ -13,5 +14,24 @@ dependencies:
- scipy
- bitstring
- pooch

# Testing
- pytest
- pytest-cov
- matplotlib
- compliance-checker
- cc-plugin-glider

# Docs
- pydata-sphinx-theme
- sphinx
- sphinx-autoapi
- numpydoc
- myst-parser

# QAQC
- pre_commit

- pip:
# Core
- dbdreader
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "pyglider"
dynamic = ["version"]
description = "Glider data to netCDF translation in python"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.9"
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
]
authors = [
{ name = "Jody Klymak", email = "[email protected]" },
]
dependencies = [
"bitstring",
"dask",
"gsw",
"netcdf4",
"polars",
"pooch",
"scipy",
"xarray",
]

[project.urls]
Homepage = "https://pyglider.readthedocs.io"

[tool.hatch.version]
path = "pyglider/_version.py"

[tool.hatch.build.targets.sdist]
include = [
"/pyglider",
]
[tool.pytest.ini_options]
addopts = ["--strict-config", "--strict-markers"]
testpaths = ["tests"]
Expand Down
33 changes: 0 additions & 33 deletions setup.py

This file was deleted.

Empty file added tests/__init__.py
Empty file.
Loading
Loading