Skip to content

Commit

Permalink
Fixes for sos and siconc of BCC models (#1090)
Browse files Browse the repository at this point in the history
* sos and siconc fixed

* tests added

* test fixed

* fix flake8

* fix flake8

* fix codacy issue
  • Loading branch information
remi-kazeroni authored May 17, 2021
1 parent b46829e commit 347d19d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
3 changes: 3 additions & 0 deletions esmvalcore/cmor/_fixes/cmip6/bcc_csm2_mr.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@


Siconc = OceanFixGrid


Sos = OceanFixGrid
6 changes: 6 additions & 0 deletions esmvalcore/cmor/_fixes/cmip6/bcc_esm1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@


Tos = OceanFixGrid


Sos = OceanFixGrid


Siconc = OceanFixGrid
20 changes: 19 additions & 1 deletion tests/integration/cmor/_fixes/cmip6/test_bcc_csm2_mr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
"""Test fixes for BCC-CSM2-MR."""
from esmvalcore.cmor._fixes.cmip6.bcc_csm2_mr import Cl, Cli, Clw, Siconc, Tos
from esmvalcore.cmor._fixes.cmip6.bcc_csm2_mr import (
Cl,
Cli,
Clw,
Siconc,
Sos,
Tos,
)
from esmvalcore.cmor._fixes.common import (
ClFixHybridPressureCoord,
OceanFixGrid,
Expand Down Expand Up @@ -60,3 +67,14 @@ def test_get_siconc_fix():
def test_siconc_fix():
"""Test fix for ``siconc``."""
assert Siconc is OceanFixGrid


def test_get_sos_fix():
"""Test getting of fix."""
fix = Fix.get_fixes('CMIP6', 'BCC-CSM2-MR', 'Omon', 'sos')
assert fix == [Sos(None)]


def test_sos_fix():
"""Test fix for ``sos``."""
assert Sos is OceanFixGrid
31 changes: 30 additions & 1 deletion tests/integration/cmor/_fixes/cmip6/test_bcc_esm1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
"""Test fixes for BCC-ESM1."""
from esmvalcore.cmor._fixes.cmip6.bcc_esm1 import Cl, Cli, Clw, Tos
from esmvalcore.cmor._fixes.cmip6.bcc_esm1 import (
Cl,
Cli,
Clw,
Siconc,
Sos,
Tos,
)
from esmvalcore.cmor._fixes.common import (
ClFixHybridPressureCoord,
OceanFixGrid,
Expand Down Expand Up @@ -40,6 +47,28 @@ def test_clw_fix():
assert Clw is ClFixHybridPressureCoord


def test_get_siconc_fix():
"""Test getting of fix."""
fix = Fix.get_fixes('CMIP6', 'BCC-ESM1', 'SImon', 'siconc')
assert fix == [Siconc(None)]


def test_siconc_fix():
"""Test fix for ``siconc``."""
assert Siconc is OceanFixGrid


def test_get_sos_fix():
"""Test getting of fix."""
fix = Fix.get_fixes('CMIP6', 'BCC-ESM1', 'Omon', 'sos')
assert fix == [Sos(None)]


def test_sos_fix():
"""Test fix for ``sos``."""
assert Sos is OceanFixGrid


def test_get_tos_fix():
"""Test getting of fix."""
fix = Fix.get_fixes('CMIP6', 'BCC-ESM1', 'Omon', 'tos')
Expand Down

0 comments on commit 347d19d

Please sign in to comment.