Skip to content

Commit

Permalink
added more test glaciers for more code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-schmitt committed Jan 18, 2022
1 parent d0eab4d commit 5239a96
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion oggm/tests/test_models.py
Expand Up @@ -3254,6 +3254,11 @@ def test_dynamic_spinup(self, hef_gdir, minimise_for):
'that the reference value is 0.!',
'RGI60-04.00331': 'Could not find mismatch smaller'
f' {precision_percent}%',
'RGI60-04.07198': '', # for code coverage (ice free at end case)
'RGI60-04.05361': 'Not able to conduct one error free run. '
'Error is "out_of_domain"',
'RGI60-04.03244': 'Not able to conduct one error free run. '
'Error is "ice_free"'
}

# change settings to match used prepro directory
Expand All @@ -3271,11 +3276,18 @@ def test_dynamic_spinup(self, hef_gdir, minimise_for):
ignore_errors = False
for gdir in gdirs:
try:
# need the min spinup period to force error
if gdir.rgi_id in ['RGI60-04.05361', 'RGI60-04.05361',
'RGI60-04.03244']:
min_spinup_period = 20
else:
min_spinup_period = 10
run_dynamic_spinup(gdir,
minimise_for=minimise_for,
precision_percent=precision_percent,
output_filesuffix='_dynamic_spinup',
ignore_errors=ignore_errors
ignore_errors=ignore_errors,
min_spinup_period=min_spinup_period,
)
except RuntimeError as e:
assert rgi_ids[gdir.rgi_id] in f'{e}'
Expand Down

0 comments on commit 5239a96

Please sign in to comment.