Skip to content

Commit

Permalink
Merge pull request #97 from unifhy-org/nutrients
Browse files Browse the repository at this point in the history
Merging nutrients components #14 into main, updating version to v1.0.0
  • Loading branch information
mattjbr123 authored Aug 2, 2024
2 parents 753c6ff + 129c46a commit 99300c6
Show file tree
Hide file tree
Showing 1,214 changed files with 211,163 additions and 35,375 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/advanced_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:

jobs:

run-basic-tests:
run-advanced-tests:

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-13]
python-version: ["3.8", "3.9", "3.10", "3.11"]
fail-fast: false

runs-on: ${{ matrix.os }}
Expand All @@ -25,7 +25,7 @@ jobs:

# check out PR HEAD commit
- name: check out PR HEAD commit
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -37,6 +37,7 @@ jobs:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
mamba-version: "*"
miniconda-version: "latest"
channels: conda-forge
channel-priority: true

Expand All @@ -49,22 +50,44 @@ jobs:
# build dummy components required for tests
- name: make gfortran available (macos only)
if: matrix.os == 'macos-latest'
if: matrix.os == 'macos-13'
run: |
sudo ln -s /usr/local/bin/gfortran-10 /usr/local/bin/gfortran
sudo ln -s /usr/local/bin/gfortran-11 /usr/local/bin/gfortran
sudo mkdir /usr/local/gfortran
sudo ln -s /usr/local/Cellar/gcc@10/*/lib/gcc/10 /usr/local/gfortran/lib
sudo ln -s /usr/local/Cellar/gcc@11*/lib/gcc/11 /usr/local/gfortran/lib
gfortran --version
- name: build dummy C and Fortran components
run: |
(cd ./tests/tests/components && make)
# install latest cf-python package
- name: install package
run: |
pip install https://github.com/NCAS-CMS/cf-python/archive/main.zip
# install package
- name: install package
run: |
pip install -e .
# run tests
- name: run advanced test suite
- name: run advanced tests 1 (SameTimeSameSpace)
run: |
(cd ./tests && python run_stss_tests.py)
# run tests
- name: run advanced tests 2 (SameTimeDiffSpace)
run: |
(cd ./tests && python run_stds_tests.py)
# run tests
- name: run advanced tests 3 (DiffTimeSameSpace)
run: |
(cd ./tests && python run_dtss_tests.py)
# run tests
- name: run advanced tests 4 (DiffTimeDiffSpace)
run: |
(cd ./tests && python run_all_tests.py)
(cd ./tests && python run_dtds_tests.py)
30 changes: 18 additions & 12 deletions .github/workflows/basic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ on:
jobs:

run-basic-tests:

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-13]
python-version: ["3.8", "3.9", "3.10", "3.11"]
fail-fast: false

runs-on: ${{ matrix.os }}

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

steps:

# check out PR HEAD commit
- name: check out PR HEAD commit
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

# set up a conda environment
- name: set up miniconda environment
uses: conda-incubator/setup-miniconda@v2
Expand All @@ -37,20 +37,26 @@ jobs:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
mamba-version: "*"
miniconda-version: "latest"
channels: conda-forge
channel-priority: true

# install dependencies on conda environment
- name: install package dependencies
run: |
mamba install udunits2=2.2.25
mamba install --file=requirements.txt
# install latest cf-python package
- name: install package
run: |
pip install https://github.com/NCAS-CMS/cf-python/archive/main.zip
# install package
- name: install package
run: |
pip install -e .
# run tests
- name: run basic test suite
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:

- name: install dependencies for framework and its documentation
run: |
mamba install --file=requirements.txt
mamba install --file=requirements-docs.txt
- name: setup git user info
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ __pycache__/
*.pyc
*.pyf
*.so
.pre-commit*

# ignore documentation built because copied in docs/ root already
docs/_doc_build
Expand Down
9 changes: 7 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
{
"name": "Richard J. Ellis",
"affiliation": "UK Centre for Ecology and Hydrology, UK"
}
},
{
"name": "Matt Brown",
"affiliation": "UK Centre for Ecology and Hydrology, UK",
"orcid": "0000-0003-1127-0279"
}
],
"title": "unifhy",
"description": "A Unified Framework for Hydrology.",
"notes": "Funded by the Natural Environment Research Council (NERC) Hydro-JULES programme (NE/S017380/1).",
"license": {
"id": "BSD-3-Clause"
}
}
}
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Unified Framework for Hydrology
.. image:: https://img.shields.io/badge/fair-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B-yellow?style=flat-square
:target: https://fair-software.eu
:alt: FAIR Software Compliance
.. image:: https://img.shields.io/github/workflow/status/unifhy-org/unifhy/Basic%20tests?style=flat-square&label=tests
.. image:: https://img.shields.io/github/actions/workflow/status/unifhy-org/unifhy/basic_tests.yml?style=flat-square&label=tests
:target: https://github.com/unifhy-org/unifhy/actions/workflows/basic_tests.yml
:alt: Tests Status

The Python package `unifhy` (Unified Framework for Hydrology) is a hydrological
modelling framework which combines interchangeable modelling components for the
surface layer, subsurface, and open water parts of the terrestrial water cycle.
By two-way coupling these three components, the framework provides a fully
The Python package `unifhy` (Unified Framework for Hydrology) is a hydrological
modelling framework which combines interchangeable modelling components for the
surface layer, subsurface, and open water parts of the terrestrial water and nutrient cycles.
By two-way coupling these six components, the framework provides a fully
functional model for simulating the terrestrial water cycle. It is designed to
foster collaborations between land surface, hydrological, and groundwater
modelling communities by structuring their interactions around standardised
Expand Down
37 changes: 33 additions & 4 deletions changelog.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
.. default-role:: obj

..
latest
------

Yet to be versioned and released. Only available from *dev* branch until then.
v1.0.0
------

.. rubric:: Dependencies

* add support for Python 3.10 and 3.11
* support dropped for cf-python <=3.16.2

.. rubric:: API changes

* 3 new Components added to framework to allow modelling of nutrient cycle
(`#14 <https://github.com/unifhy-org/unifhy/issues/14>`_)
* Unit tests updated to include the 3 new Components
(`#93 <https://github.com/unifhy-org/unifhy/issues/93>`_)

.. rubric:: Bug fixes

* fix `DataComponent`/`NullComponent` bug making them unusable as
substitute components in a `Model`
(`#87 <https://github.com/unifhy-org/unifhy/issues/87>`_)
* fix broken grid cell area calculation with CF-Python version 3.14.0 and above
(`#98 <https://github.com/unifhy-org/unifhy/issues/98>`_)
* fix broken grid subsetting with CF-Python 3.16.2
(`#101 <https://github.com/unifhy-org/unifhy/issues/101>`_)


.. rubric:: Documentation

* Update documentation to include Nutrient Components
(`#99 <https://github.com/unifhy-org/unifhy/issues/99>`_)
* Added Developer section to documentation to document how to add new transfers and Components to the framework
(`#96 <https://github.com/unifhy-org/unifhy/issues/96>`_)


v0.1.1
------
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 296a6d03df30610eda09667a1e37e1ea
config: 05958782197871c0315be596afe948ce
tags: 645f666f9bcd5a90fca523b33c5a78b7
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.X
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.X
.. autoattribute:: unifhy.BritishNationalGrid.X
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.X_bounds
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.X_bounds
.. autoattribute:: unifhy.BritishNationalGrid.X_bounds
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.X_name
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.X_name
.. autoattribute:: unifhy.BritishNationalGrid.X_name
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.Y
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.Y
.. autoattribute:: unifhy.BritishNationalGrid.Y
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.Y_bounds
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.Y_bounds
.. autoattribute:: unifhy.BritishNationalGrid.Y_bounds
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.Y_name
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.Y_name
.. autoattribute:: unifhy.BritishNationalGrid.Y_name
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.axes
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.axes
.. autoattribute:: unifhy.BritishNationalGrid.axes
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.cell_area
.. autoattribute:: unifhy.BritishNationalGrid.cell_area
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.flow_direction
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.flow_direction
.. autoattribute:: unifhy.BritishNationalGrid.flow_direction
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.land_sea_mask
.. autoattribute:: unifhy.BritishNationalGrid.land_sea_mask
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.BritishNationalGrid.shape
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.BritishNationalGrid.shape
.. autoattribute:: unifhy.BritishNationalGrid.shape
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.X
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.X
.. autoattribute:: unifhy.LatLonGrid.X
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.X_bounds
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.X_bounds
.. autoattribute:: unifhy.LatLonGrid.X_bounds
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.X_name
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.X_name
.. autoattribute:: unifhy.LatLonGrid.X_name
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.Y
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.Y
.. autoattribute:: unifhy.LatLonGrid.Y
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.Y_bounds
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.Y_bounds
.. autoattribute:: unifhy.LatLonGrid.Y_bounds
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.Y_name
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.Y_name
.. autoattribute:: unifhy.LatLonGrid.Y_name
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.axes
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.axes
.. autoattribute:: unifhy.LatLonGrid.axes
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.cell_area
.. autoattribute:: unifhy.LatLonGrid.cell_area
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ unifhy.LatLonGrid.flow_direction
.. currentmodule:: unifhy
.. default-role:: obj

.. autoattribute:: unifhy.LatLonGrid.flow_direction
.. autoattribute:: unifhy.LatLonGrid.flow_direction
Loading

0 comments on commit 99300c6

Please sign in to comment.