Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "Bot"
21 changes: 12 additions & 9 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Deploy docs
name: Documentation

on:
pull_request:
Expand All @@ -19,23 +19,26 @@ jobs:
with:
fetch-depth: 0

- name: Setup Mamba
uses: mamba-org/provision-with-micromamba@v13
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
environment-name: TEST
init-shell: bash
create-args: >-
python=3 pip
--file requirements.txt
--file requirements-dev.txt
--channel conda-forge

- name: Build environment
- name: Install ciso
shell: bash -l {0}
run: |
micromamba create --name TEST python=3 --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
python -m pip install -e . --no-deps --force-reinstall

- name: Build documentation
shell: bash -l {0}
run: |
set -e
micromamba activate TEST
jupyter nbconvert --to notebook --execute notebooks/ciso_unstructure.ipynb --output=ciso_unstructure-output.ipynb
jupyter nbconvert --to notebook --execute notebooks/ciso_c_grid.ipynb --output=ciso_c_grid-output.ipynb
mv notebooks/*output.ipynb docs/source/
Expand All @@ -44,7 +47,7 @@ jobs:
popd

- name: Deploy
if: github.event_name == 'release' || github.event_name == 'push'
if: success() && github.event_name == 'release'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,30 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@v13
- name: Setup Micromamba ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
environment-name: TEST
init-shell: bash
create-args: >-
python=${{ matrix.python-version }} pip
--file requirements.txt
--file requirements-dev.txt
--channel conda-forge

- name: Python ${{ matrix.python-version }}
- name: Install ciso
shell: bash -l {0}
run: |
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
python -m pip install -e . --no-deps --force-reinstall

- name: Tests
shell: bash -l {0}
run: |
micromamba activate TEST
python -m pytest -rxs ciso/tests
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-ast
Expand All @@ -13,32 +13,32 @@ repos:
files: requirements-dev.txt

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
exclude: docs/source/conf.py
args: [--max-line-length=105]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
additional_dependencies: [toml]
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/keewis/blackdoc
rev: v0.3.7
rev: v0.3.8
hooks:
- id: blackdoc

- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.4
hooks:
- id: codespell
exclude: >
Expand All @@ -49,24 +49,24 @@ repos:
- --quiet-level=2

- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
rev: v3.4.0
hooks:
- id: pyupgrade
args:
- --py36-plus

- repo: https://github.com/dosisod/refurb
rev: v1.4.0
rev: v1.16.0
hooks:
- id: refurb

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.3.0
rev: v2.4.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
rev: 6.3.0
hooks:
- id: pydocstyle
exclude: ^(docs|setup.py|ciso/tests)
Expand Down
7 changes: 3 additions & 4 deletions notebooks/ciso_c_grid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
"outputs": [],
"source": [
"import warnings\n",
"\n",
"import iris\n",
"\n",
"url = \"https://tds.marine.rutgers.edu/thredds/dodsC/roms/doppio/2017_da/avg/Averages_Best\"\n",
"\n",
"url = \"https://tds.marine.rutgers.edu/thredds/dodsC/roms/doppio/2017_da/avg/Averages_Best\"\n",
"\n",
"with warnings.catch_warnings():\n",
" warnings.simplefilter(\"ignore\")\n",
" cubes = iris.load(url)"
" cubes = iris.load_raw(url)"
]
},
{
Expand Down Expand Up @@ -119,7 +118,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.11.3"
}
},
"nbformat": 4,
Expand Down
11 changes: 6 additions & 5 deletions notebooks/ciso_unstructure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
"outputs": [],
"source": [
"import warnings\n",
"\n",
"import iris\n",
"\n",
"url = \"http://www.smast.umassd.edu:8080/thredds/dodsC/FVCOM/NECOFS/Forecasts/NECOFS_GOM3_FORECAST.nc\"\n",
"\n",
"url = \"http://www.smast.umassd.edu:8080/thredds/dodsC/FVCOM/NECOFS/Forecasts/NECOFS_GOM3_FORECAST.nc\"\n",
"\n",
"with warnings.catch_warnings():\n",
" warnings.simplefilter(\"ignore\")\n",
" cubes = iris.load(url)"
" cubes = iris.load_raw(url)"
]
},
{
Expand Down Expand Up @@ -58,8 +57,8 @@
"import numpy as np\n",
"from ciso import zslice\n",
"\n",
"p0 = -25\n",
"\n",
"p0 = -25\n",
"isoslice = zslice(q, p, -50)"
]
},
Expand All @@ -71,6 +70,7 @@
"source": [
"import numpy.ma as ma\n",
"\n",
"\n",
"# Cannot tricontourf with NaNs.\n",
"isoslice = ma.masked_invalid(isoslice)\n",
"vmin, vmax = isoslice.min(), isoslice.max()\n",
Expand Down Expand Up @@ -107,6 +107,7 @@
"source": [
"import gridgeo\n",
"\n",
"\n",
"grid = gridgeo.GridGeo(url, standard_name=\"sea_water_salinity\")"
]
},
Expand Down Expand Up @@ -146,7 +147,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.11.3"
}
},
"nbformat": 4,
Expand Down