Skip to content

Commit

Permalink
Fix Scipy and other updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaussion committed Feb 11, 2023
1 parent 197b2f2 commit 616bedc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions oggm/core/centerlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _filter_lines_slope(lines, heads, topo, gdir, min_slope):
# (0, 0) is also located in the center of the pixel
xy = (np.arange(0, gdir.grid.ny-0.1, 1),
np.arange(0, gdir.grid.nx-0.1, 1))
interpolator = RegularGridInterpolator(xy, topo)
interpolator = RegularGridInterpolator(xy, topo.astype(np.float64))

olines = [lines[0]]
oheads = [heads[0]]
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def compute_downstream_bedshape(gdir):
x = nc.variables['x'][:]
y = nc.variables['y'][:]
xy = (np.arange(0, len(y)-0.1, 1), np.arange(0, len(x)-0.1, 1))
interpolator = RegularGridInterpolator(xy, topo)
interpolator = RegularGridInterpolator(xy, topo.astype(np.float64))

bs, terrain_heights = _parabolic_bed_from_topo(gdir, cl, interpolator)
assert len(bs) == cl.nx, 'len(bs) == cl.nx'
Expand Down Expand Up @@ -1732,7 +1732,7 @@ def initialize_flowlines(gdir):
# (0, 0) is also located in the center of the pixel
xy = (np.arange(0, gdir.grid.ny-0.1, 1),
np.arange(0, gdir.grid.nx-0.1, 1))
interpolator = RegularGridInterpolator(xy, topo)
interpolator = RegularGridInterpolator(xy, topo.astype(np.float64))

# Smooth window
sw = cfg.PARAMS['flowline_height_smooth']
Expand Down
2 changes: 1 addition & 1 deletion oggm/tests/test_prepro.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def test_downstream_bedshape(self):
x = nc.variables['x'][:]
y = nc.variables['y'][:]
xy = (np.arange(0, len(y) - 0.1, 1), np.arange(0, len(x) - 0.1, 1))
interpolator = RegularGridInterpolator(xy, topo)
interpolator = RegularGridInterpolator(xy, topo.astype(np.float64))

zref = [interpolator((p.xy[1][0], p.xy[0][0])) for p in points]

Expand Down
5 changes: 4 additions & 1 deletion oggm/utils/_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,10 @@ def filter_rgi_name(name):
This seems to be unnecessary with RGI V6
"""

if name is None or len(name) == 0:
try:
if name is None or len(name) == 0:
return ''
except TypeError:
return ''

if name[-1] in ['À', 'È', 'è', '\x9c', '3', 'Ð', '°', '¾',
Expand Down
1 change: 0 additions & 1 deletion oggm/utils/_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2617,7 +2617,6 @@ def __init__(self, rgi_entity, base_dir=None, reset=False,
self.rgi_subregion = (self.rgi_region + '-' +
'{:02d}'.format(int(rgi_entity.O2Region)))


try:
name = str(rgi_entity.name)
rgi_datestr = rgi_entity.src_date
Expand Down

0 comments on commit 616bedc

Please sign in to comment.