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
24 changes: 15 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ 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"
channels: conda-forge
channels: conda-forge,default
channel-priority: true

- name: Show conda installation info
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ 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 }}
channels: conda-forge
miniforge-variant: Miniforge3
miniforge-version: latest
channels: conda-forge,defaults
channel-priority: true

- name: Show conda installation info
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/how_to_guides/install/developer_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <virtual_environments>`.
{ref}`virtual environment <virtual-environments>`.
:::

If you will be modifying code or contributing new code to *sequence*, you will first
Expand Down
2 changes: 1 addition & 1 deletion docs/how_to_guides/install/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <virtual_environments>`.
{ref}`virtual environment <virtual-environments>`.
:::

<!-- start-install-release -->
Expand Down
2 changes: 1 addition & 1 deletion docs/how_to_guides/install/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <virtual_environments>`.
{ref}`virtual environment <virtual-environments>`.
:::

<!-- start-install-release -->
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ sphinx-click
sphinx-inline-tabs
sphinx_copybutton
sphinxcontrib.towncrier
towncrier<24
3 changes: 3 additions & 0 deletions news/86.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Fixed some failing CI workflows due to old versions of GitHub Actions
and *numpy* 2.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"compaction",
"landlab",
"netcdf4",
"numpy >=1.22",
"numpy >=1.22, <2",
"pyyaml",
"rich-click",
"scipy",
Expand Down
6 changes: 3 additions & 3 deletions sequence/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.])

Expand Down Expand Up @@ -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.])
"""
Expand Down
2 changes: 1 addition & 1 deletion sequence/sediment_flexure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion sequence/shoreline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sequence/submarine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down