Skip to content

Commit

Permalink
Merge branch '72-nitrous-oxide' of github.com:pmlmodelling/ersem-dev …
Browse files Browse the repository at this point in the history
…into 72-nitrous-oxide
  • Loading branch information
glessin committed Aug 4, 2022
2 parents f4d8cef + 0fce61d commit 2d7b0ce
Show file tree
Hide file tree
Showing 6 changed files with 729 additions and 696 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ersem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
run: ./github-actions/pyfabm-ersem/pyfabm-ersem-dep-debian.sh
- name: Building and installing PyFABM-ERSEM
run: |
branch=$(git branch --show-current)
./github-actions/pyfabm-ersem/pyfabm-ersem-build.sh $branch
BRANCH=${{ github.head_ref }}
./github-actions/pyfabm-ersem/pyfabm-ersem-build.sh $BRANCH
- name: Running pyfabm tutorial
run: |
python -m pip install matplotlib
Expand All @@ -44,8 +44,8 @@ jobs:
run: ./github-actions/gotm-fabm-ersem/gotm-fabm-ersem-dep-debian.sh
- name: Building and installing GOTM-FABM-ERSEM
run: |
branch=$(git branch --show-current)
./github-actions/gotm-fabm-ersem/gotm-fabm-ersem-build.sh -b $branch
BRANCH=${{ github.head_ref }}
./github-actions/gotm-fabm-ersem/gotm-fabm-ersem-build.sh -b $BRANCH
- name: Running tutorial
run: |
./github-actions/gotm-fabm-ersem/gotm-tut-config-setup.sh
Expand All @@ -69,8 +69,8 @@ jobs:
run: ./github-actions/fabm0d-gotm-ersem/fabm0d-gotm-ersem-dep-debian.sh
- name: Building and installing FABM0d-GOTM-ERSEM
run: |
branch=$(git branch --show-current)
./github-actions/fabm0d-gotm-ersem/fabm0d-gotm-ersem-build.sh $branch
BRANCH=${{ github.head_ref }}
./github-actions/fabm0d-gotm-ersem/fabm0d-gotm-ersem-build.sh -b $BRANCH
- name: Running tutorial
run: |
./github-actions/fabm0d-gotm-ersem/aquarium-tut-config-setup.sh
Expand All @@ -93,8 +93,8 @@ jobs:
run: ./github-actions/gotm-fabm-ersem/gotm-fabm-ersem-dep-debian.sh
- name: Building and installing GOTM-FABM-ERSEM
run: |
branch=$(git branch --show-current)
./github-actions/gotm-fabm-ersem/gotm-fabm-ersem-build.sh -f "-DCMAKE_Fortran_FLAGS="-pg""
BRANCH=${{ github.head_ref }}
./github-actions/gotm-fabm-ersem/gotm-fabm-ersem-build.sh -f "-DCMAKE_Fortran_FLAGS="-pg"" -b $BRANCH
- name: Running config
run: |
./github-actions/gotm-fabm-ersem/gotm-profiling.sh
Expand Down
2 changes: 1 addition & 1 deletion github-actions/fabm0d-gotm-ersem/expected.json

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions github-actions/fabm0d-gotm-ersem/test_aquarium.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import aquarium_tut


class AquariumTests(unittest.TestCase):
"""
Aquarium 0D model tests
Expand All @@ -28,6 +29,7 @@ def setUp(self, mock_show):
self.expected = json.load(fp)
self.value_dict = aquarium_tut.main(self.model_path)


def test_dates_value(self):
"""
Checks the dates (dates) values are the same
Expand All @@ -41,46 +43,46 @@ def test_light_value(self):
values are the same
"""
name = "light_parEIR"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_temp_value(self):
"""
Checks the temp (temp) values are the same
"""
name = "temp"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_salt_value(self):
"""
Checks the salinity (salt) values are the same
"""
name = "salt"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_phosphorus_value(self):
"""
Checks the phosphate phosphorus (N1_p) values are the same
"""
name = "N1_p"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_nitrogen_value(self):
"""
Checks the nitrate nitrogen (N3_n) values are the same
"""
name = "N3_n"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_bcarbon_value(self):
"""
Checks the bacteria carbon (B1_c) values are the same
"""
name = "B1_c"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_ncarbon_value(self):
"""
Checks the nanophytoplankton carbon (P2_c) values are the same
"""
name = "B1_c"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])
Loading

0 comments on commit 2d7b0ce

Please sign in to comment.