Skip to content

Commit

Permalink
Adapted dynamic tests (OGGM#8)
Browse files Browse the repository at this point in the history
* updated dynamic tests

* update demo_glaciers
  • Loading branch information
pat-schmitt committed Mar 7, 2023
1 parent 5a210dd commit ef5841d
Show file tree
Hide file tree
Showing 4 changed files with 209 additions and 365 deletions.
2 changes: 1 addition & 1 deletion oggm/core/dynamic_spinup.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def save_model_without_dynamic_spinup():
return model_dynamic_spinup_end
else:
raise RuntimeError('The difference between the rgi_date and the '
'start year of the climate data is to small to '
'start year of the climate data is too small to '
'run a dynamic spinup!')

# here we define the flowline we want to match, it is assumed that during
Expand Down
12 changes: 4 additions & 8 deletions oggm/data/demo_glaciers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ RGI60-11.00746,gep,Gepatschferner
RGI60-01.10689,columbia,Columbia Glacier
RGI60-08.01097,briksdalsbreen,Briksdalsbreen
RGI60-13.04946,samoilowich,Samoilowich
RGI60-04.00044,dynspin1,dynspin1
RGI60-02.09397,dynspin2,dynspin2
RGI60-04.05259,dynspin3,dynspin3
RGI60-04.00381,dynspin4,dynspin4
RGI60-04.00331,dynspin5,dynspin5
RGI60-04.07198,dynspin6,dynspin6
RGI60-04.05361,dynspin7,dynspin7
RGI60-04.03244,dynspin8,dynspin8
RGI60-04.03249,dynspin1,dynspin1
RGI60-04.03109,dynspin2,dynspin2
RGI60-04.02180,dynspin3,dynspin3
RGI60-11.00033,dynspin4,dynspin4
18 changes: 7 additions & 11 deletions oggm/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,17 @@ def secure_url_retrieve(url, *args, **kwargs):

# We added a few extra glaciers recently - this really needs to be
# handled better
base_extra_L4 = ('cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/'
'L3-L5_files/ERA5/elev_bands/qc3/pcp1.6/match_geod_pergla/'
'RGI62/b_160/L4/')
base_extra_L3 = ('cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/'
'L3-L5_files/ERA5/elev_bands/qc3/pcp1.6/match_geod_pergla/'
'RGI62/b_160/L3/')
base_extra_l3 = ('https://cluster.klima.uni-bremen.de/~oggm/gdirs/'
'oggm_v1.6/L3-L5_files/2023.1/elev_bands/W5E5/RGI62/'
'b_160/L3/')

base_extra_v14 = ('https://cluster.klima.uni-bremen.de/~oggm/gdirs/'
'oggm_v1.4/L1-L2_files/elev_bands/RGI62/b_040/{}/'
'RGI60-15/RGI60-15.13.tar')

base_extra_v14l3 = ('https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/L3-L5_files/CRU/elev_bands/'
'qc3/pcp2.5/no_match/RGI62/b_040/{}/'
'RGI60-15/RGI60-15.13.tar')
base_extra_v14l3 = ('https://cluster.klima.uni-bremen.de/~oggm/gdirs/'
'oggm_v1.4/L3-L5_files/CRU/elev_bands/qc3/pcp2.5/'
'no_match/RGI62/b_040/{}/RGI60-15/RGI60-15.13.tar')

assert ('github' in url or
'cluster.klima.uni-bremen.de/~oggm/ref_mb_params' in url or
Expand All @@ -189,8 +186,7 @@ def secure_url_retrieve(url, *args, **kwargs):
base_extra_v14.format('L1') in url or
base_extra_v14.format('L2') in url or
base_extra_v14l3.format('L3') in url or
base_extra_L4 in url or
base_extra_L3 in url
base_extra_l3 in url
)
return oggm_urlretrieve(url, *args, **kwargs)

Expand Down
Loading

0 comments on commit ef5841d

Please sign in to comment.