Skip to content

Commit 9d42d70

Browse files
committed
Added .<ext>.nc additional path to allowed input files in check inputs
1 parent a1855eb commit 9d42d70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lisflood/hydrological_modules/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ def is_path(v):
4141
return False
4242
path_no_ext, current_ext = os.path.splitext(v)
4343
v_alt = '{}.{}'.format(path_no_ext, 'nc' if current_ext in ('.map', '') else 'map')
44+
v_alt2 = v if v.lower().endswith('.nc') else v + '.nc'
4445
a = (os.path.exists(v) and os.path.isfile(v)) or os.access(v, os.W_OK)
4546
b = (os.path.exists(v_alt) and os.path.isfile(v_alt)) or os.access(v_alt, os.W_OK)
46-
return a or b
47+
c = (os.path.exists(v_alt2) and os.path.isfile(v_alt2)) or os.access(v_alt2, os.W_OK)
48+
return a or b or c
4749

4850

4951
class HydroModule(object):

0 commit comments

Comments
 (0)