Skip to content
Merged

Main #21

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
63 changes: 28 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,25 @@ jobs:
run: uvx twine check --strict dist/*

lint:
name: Lint
name: lint
runs-on: ubuntu-latest
defaults:
run:
shell: bash
timeout-minutes: 10

steps:
- name: Checkout repo
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Python
uses: astral-sh/setup-uv@v5
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.2
with:
enable-cache: false
pixi-version: v0.41.4

- name: Lint
run: uvx ruff check
- name: Check python lint
run: pixi run check-lint

- name: Check format
run: uvx ruff format --check
- name: Check python format
run: pixi run check-format

- name: Check spelling
run: uvx codespell
run: pixi run check-spelling

mf6adjCI:
name: autotest
Expand All @@ -71,43 +66,41 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
#python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: ["3.10"]
run-type: [std]
test-path: ["."]
#include:
# - os: macos-latest
# python-version: 3.9
defaults:
run:
shell: bash -l {0}
shell: bash

steps:
- name: Checkout repo
uses: actions/checkout@v3 # checksout this repo
uses: actions/checkout@v3

# Setup conda env
- name: Install Conda environment using micromamba
uses: mamba-org/setup-micromamba@v1
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
environment-file: environment.yml
environment-name: mf6adj
cache-downloads: false
create-args: |
python=${{ matrix.python-version }}
pixi-version: v0.59.0

- name: pixi post-install
run: |
pixi run postinstall

- name: Update flopy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pixi run update-flopy

- name: Install executables
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
get-modflow --subset mf6,libmf6,gridgen :python
pixi run install-executables

- name: Autotest ${{ matrix.os }}-python${{ matrix.python-version }}
working-directory: ./autotest
run: |
pytest -v -n=auto --durations=0
pixi run autotest-base

- name: Test notebooks ${{ matrix.os }}-python${{ matrix.python-version }}
working-directory: ./examples
run: |
pytest -v -n=auto --durations=0 --nbmake --nbmake-timeout=3000
pixi run autotest-notebooks
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ examples/freyberg/
examples/sanpedro/
examples/xd_box_chd_ana_working
autotest/*_test*/
.figures/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

`mamba env create -f environment.yml`

Activate the environment and add the MODFLOW6 executables to the mamba environment bin with the following:

`mamba activate mf6adj`

`get-modflow --subset mf6,libmf6,gridgen :python`

## Examples

Several notebooks are provide that demonstrate how to use `mf6adj`
3 changes: 3 additions & 0 deletions autotest/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import pytest

pytest_plugins = ["modflow_devtools.fixtures"]
Loading