From cc0a849a695b017de087d7dee6c8c7d056e29451 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 11:20:55 -0700 Subject: [PATCH 01/12] update action for building the docs --- .github/workflows/docs.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 58a120a..d61b682 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,17 +19,23 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: mamba-org/setup-micromamba@v1 + - uses: conda-incubator/setup-miniconda@v3 with: - micromamba-version: latest - environment-name: testing - create-args: >- - python=3.11 - mamba - pandoc - nox + python-version: 3.12 + miniforge-variant: Miniforge3 + miniforge-version: latest + auto-update-conda: true + + - name: install and check pandoc + run: | + conda install pandoc -c conda-forge + pandoc --help + pandoc --version + + - name: Install dependencies + run: pip install nox - name: Build documentation run: nox -s build-docs From 4aae66fc717bbb13d9279d3e948abf68df0f340a Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 11:21:24 -0700 Subject: [PATCH 02/12] bump actions for lint workflow --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3d8d00f..92ddc7c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,9 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python 3.12 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.12 From 10d58a8b31a4d8ba0777ab7b6be54d6da4a9890b Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 11:21:39 -0700 Subject: [PATCH 03/12] bump actions for notebooks workflow --- .github/workflows/notebooks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index 81ac9b9..ba4bdec 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -19,8 +19,8 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: "3.11" From 3996d2a8d0a64e3acd8b96b1f50097290cbfdbff Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 11:21:56 -0700 Subject: [PATCH 04/12] bump actions for test workflow --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4090cee..458a47c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,12 +23,14 @@ jobs: python-version: ["3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: ${{ matrix.python-version }} + miniforge-variant: Miniforge3 + miniforge-version: latest channels: conda-forge channel-priority: true From e8d3f042f296e104eb0c7705eb58eb2b1b5acbd0 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 12:54:06 -0700 Subject: [PATCH 05/12] require numpy less than 2 for now --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b5eeac5..b719199 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "compaction", "landlab", "netcdf4", - "numpy >=1.22", + "numpy >=1.22, <2", "pyyaml", "rich-click", "scipy", From 0284f7e9b6046830efd4086b4f7243d3630d7d93 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 13:22:57 -0700 Subject: [PATCH 06/12] adjust expected whitespace in doctests for numpy --- sequence/grid.py | 6 +++--- sequence/sediment_flexure.py | 2 +- sequence/submarine.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sequence/grid.py b/sequence/grid.py index 371e2bf..b9f7e8d 100644 --- a/sequence/grid.py +++ b/sequence/grid.py @@ -37,7 +37,7 @@ def __init__( >>> from sequence.grid import SequenceModelGrid >>> grid = SequenceModelGrid(5, spacing=10.0) >>> grid.y_of_row - array([ 0., 1., 2.]) + array([0., 1., 2.]) >>> grid.x_of_column array([ 0., 10., 20., 30., 40.]) @@ -155,14 +155,14 @@ def from_dict(cls, params: dict) -> SequenceModelGrid: >>> params = {"shape": 5, "spacing": 10.0} >>> grid = SequenceModelGrid.from_dict(params) >>> grid.y_of_row - array([ 0., 1., 2.]) + array([0., 1., 2.]) >>> grid.x_of_column array([ 0., 10., 20., 30., 40.]) >>> params = {"shape": (3, 5), "spacing": (10000.0, 10.0)} >>> grid = SequenceModelGrid.from_dict(params) >>> grid.y_of_row - array([ 0., 10000., 20000., 30000., 40000.]) + array([ 0., 10000., 20000., 30000., 40000.]) >>> grid.x_of_column array([ 0., 10., 20., 30., 40.]) """ diff --git a/sequence/sediment_flexure.py b/sequence/sediment_flexure.py index a5a35f8..aee8d16 100644 --- a/sequence/sediment_flexure.py +++ b/sequence/sediment_flexure.py @@ -537,7 +537,7 @@ def _calc_density( >>> SedimentFlexure._calc_density(0.5, 1600, 1200) 1400.0 >>> SedimentFlexure._calc_density([1.0, 0.75, 0.5, 0.25, 0.0], 1600.0, 1200.0) - array([ 1600., 1500., 1400., 1300., 1200.]) + array([1600., 1500., 1400., 1300., 1200.]) """ sand_fraction = np.asarray(sand_fraction) return sand_fraction * sand_density + (1.0 - sand_fraction) * mud_density diff --git a/sequence/submarine.py b/sequence/submarine.py index 5d0a316..c66a58f 100644 --- a/sequence/submarine.py +++ b/sequence/submarine.py @@ -227,7 +227,7 @@ def calc_diffusion_coef( >>> diffusion_coef = submarine_diffuser.calc_diffusion_coef(x_of_shore=500.0) >>> np.round(diffusion_coef.reshape((3, 6))[1]) - array([ 3750., 3750., 3750., 333., 11., 16.]) + array([3750., 3750., 3750., 333., 11., 16.]) The calculated diffusion coefficient is also saved as an *at-node* field. From a92049532fd3ae672baaf1007ff4d0ce7ae26d4b Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 15:00:34 -0700 Subject: [PATCH 07/12] check if shoreline is exactly at index --- sequence/shoreline.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sequence/shoreline.py b/sequence/shoreline.py index 41789aa..d562a9e 100644 --- a/sequence/shoreline.py +++ b/sequence/shoreline.py @@ -298,7 +298,12 @@ def find_shoreline( x_of_shoreline = x[-1] else: func = interpolate.interp1d(x, z[row] - sea_level, kind=kind) - x_of_shoreline = bisect(func, x[index_at_shore - 1], x[index_at_shore]) + if np.isclose(func(x[index_at_shore - 1]), 0.0): + x_of_shoreline = x[index_at_shore - 1] + elif np.isclose(func(x[index_at_shore]), 0.0): + x_of_shoreline = x[index_at_shore] + else: + x_of_shoreline = bisect(func, x[index_at_shore - 1], x[index_at_shore]) x_of_shorelines[row] = x_of_shoreline if n_rows == 1: From 109d50e8a1b912f845b919a6a5618084cc7f6945 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 19:51:10 -0700 Subject: [PATCH 08/12] require towncrier < 24 --- docs/requirements.in | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.in b/docs/requirements.in index daf021a..e5e0320 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -8,3 +8,4 @@ sphinx-click sphinx-inline-tabs sphinx_copybutton sphinxcontrib.towncrier +towncrier<24 From a068e8d836b9324d1501979982d4b01ee4ab6d9e Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 19:54:31 -0700 Subject: [PATCH 09/12] remove types-all, add types-pyyaml for mypy linter --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e1d31cc..5b615c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -91,8 +91,9 @@ repos: rev: v1.7.1 hooks: - id: mypy - additional_dependencies: [types-all] + language_version: python3.12 files: sequence/.*\.py$ + additional_dependencies: ["types-pyyaml"] - repo: https://github.com/citation-file-format/cff-converter-python rev: 44e8fc9174119805b64b0b333aa69d285a866673 From a8ba4ba592e0bf7a45717c4669acbcd8d8c462f2 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Mon, 20 Jan 2025 19:58:24 -0700 Subject: [PATCH 10/12] use dashes for virtual-environments label --- docs/how_to_guides/install/developer_install.md | 2 +- docs/how_to_guides/install/index.md | 2 +- docs/how_to_guides/install/installation.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/how_to_guides/install/developer_install.md b/docs/how_to_guides/install/developer_install.md index 8118907..2cca865 100644 --- a/docs/how_to_guides/install/developer_install.md +++ b/docs/how_to_guides/install/developer_install.md @@ -5,7 +5,7 @@ :::{important} The following commands will install *sequence* into your current environment. Although not necessary, we **highly recommend** you install sequence into its own -{ref}`virtual environment `. +{ref}`virtual environment `. ::: If you will be modifying code or contributing new code to *sequence*, you will first diff --git a/docs/how_to_guides/install/index.md b/docs/how_to_guides/install/index.md index 3cdc327..14a09d2 100644 --- a/docs/how_to_guides/install/index.md +++ b/docs/how_to_guides/install/index.md @@ -9,7 +9,7 @@ :::{important} The following commands will install *sequence* into your current environment. Although not necessary, we **highly recommend** you install sequence into its own -{ref}`virtual environment `. +{ref}`virtual environment `. ::: diff --git a/docs/how_to_guides/install/installation.md b/docs/how_to_guides/install/installation.md index 5de637d..8503a88 100644 --- a/docs/how_to_guides/install/installation.md +++ b/docs/how_to_guides/install/installation.md @@ -5,7 +5,7 @@ :::{important} The following commands will install *sequence* into your current environment. Although not necessary, we **highly recommend** you install sequence into its own -{ref}`virtual environment `. +{ref}`virtual environment `. ::: From db5f5de83a5e02c7e651fca23262bdf68e2dd15e Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 21 Jan 2025 12:08:22 -0700 Subject: [PATCH 11/12] add defaults channel to list of channels for setup-miniconda --- .github/workflows/notebooks.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml index ba4bdec..83c6813 100644 --- a/.github/workflows/notebooks.yml +++ b/.github/workflows/notebooks.yml @@ -24,7 +24,7 @@ jobs: with: auto-update-conda: true python-version: "3.11" - channels: conda-forge + channels: conda-forge,default channel-priority: true - name: Show conda installation info diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 458a47c..0ce4ee0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: python-version: ${{ matrix.python-version }} miniforge-variant: Miniforge3 miniforge-version: latest - channels: conda-forge + channels: conda-forge,defaults channel-priority: true - name: Show conda installation info From 47aa78222fa5e41dce803fbd11a2a91f2fccc741 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 21 Jan 2025 12:23:44 -0700 Subject: [PATCH 12/12] add news fragment [skip-ci] --- news/86.misc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 news/86.misc diff --git a/news/86.misc b/news/86.misc new file mode 100644 index 0000000..262a981 --- /dev/null +++ b/news/86.misc @@ -0,0 +1,3 @@ + +Fixed some failing CI workflows due to old versions of GitHub Actions +and *numpy* 2.