Skip to content

Commit

Permalink
Wow weird
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Feb 11, 2023
1 parent 616bedc commit 77cd2eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions oggm/core/dynamic_spinup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import copy
import os
import warnings

# External libs
import numpy as np
Expand Down Expand Up @@ -309,13 +310,13 @@ def save_model_without_dynamic_spinup():
y0=yr_use,
**kwargs)

with np.warnings.catch_warnings():
with warnings.catch_warnings():
if ye < yr_use:
yr_run = yr_use
else:
yr_run = ye
# For operational runs we ignore the warnings
np.warnings.filterwarnings('ignore', category=RuntimeWarning)
warnings.filterwarnings('ignore', category=RuntimeWarning)
model_dynamic_spinup_end.run_until_and_store(
yr_run,
geom_path=geom_path,
Expand Down Expand Up @@ -860,9 +861,9 @@ def get_mismatch(t_bias):

# here only save the final model state if store_model_evolution = False
if not store_model_evolution:
with np.warnings.catch_warnings():
with warnings.catch_warnings():
# For operational runs we ignore the warnings
np.warnings.filterwarnings('ignore', category=RuntimeWarning)
warnings.filterwarnings('ignore', category=RuntimeWarning)
model_dynamic_spinup_end[-1].run_until_and_store(
yr_rgi,
geom_path=geom_path,
Expand Down
4 changes: 2 additions & 2 deletions oggm/core/flowline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3330,9 +3330,9 @@ def flowline_model_run(gdir, output_filesuffix=None, mb_model=None,
water_level=water_level,
**kwargs)

with np.warnings.catch_warnings():
with warnings.catch_warnings():
# For operational runs we ignore the warnings
np.warnings.filterwarnings('ignore', category=RuntimeWarning)
warnings.filterwarnings('ignore', category=RuntimeWarning)
model.run_until_and_store(ye,
geom_path=geom_path,
diag_path=diag_path,
Expand Down

0 comments on commit 77cd2eb

Please sign in to comment.