Skip to content

Commit

Permalink
Error when connectivity level 2 is used, and small bugfixes in Millan22
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Oct 26, 2022
1 parent 732eb77 commit 504f3b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions oggm/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,12 @@ def _check_rgi_input(rgidf=None, err_on_lvl2=False):
# Check for Connectivity level 2 here as well
not_good_ids = pd.read_csv(utils.get_demo_file('rgi6_ids_conn_lvl2.csv'),
index_col=0)
if err_on_lvl2 and len(not_good_ids.loc[rgi_ids]) > 0:
raise RuntimeError(msg)
try:
if err_on_lvl2 and len(not_good_ids.loc[rgi_ids]) > 0:
raise RuntimeError(msg)
except KeyError:
# Were good
pass

u, c = np.unique(rgi_ids, return_counts=True)
if len(u) < len(rgi_ids):
Expand Down

0 comments on commit 504f3b5

Please sign in to comment.