Skip to content

Commit

Permalink
fix exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarnhart committed Aug 21, 2024
1 parent f61d155 commit 987417a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/tsunami/chile2010_fgmax-fgout/use_xarray_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
try:
import rioxarray
import xarray as xr
except:
except ImportError:
"You must install xarray and rioxarray in order to use the xarray backends"
raise

Expand All @@ -30,7 +30,7 @@
"epsg": epsg_code,
"qmap": "geoclaw",
# qmap is the qmap specified to the fgout object in setrun.py see
# the following documentation page for more details.
# the following documentation page for more details.
# https://www.clawpack.org/dev/fgout.html#specifying-q-out-vars
"dry_tolerance": None,
# variables that are not eta and B are masked
Expand All @@ -56,7 +56,9 @@
engine=FGOutBackend,
backend_kwargs={"epsg": epsg_code, "qmap": "geoclaw"},
)
except ImportError: # if dask is not available, use xr.concat.
except ValueError: # if dask is not available, use xr.concat.
# if dask is not installed xr.open_mfdataset() will fail with something like
# ValueError: unrecognized chunk manager dask - must be one of: []
fgouts = []
for filename in fgout_files:
ds = xr.open_dataset(
Expand Down

0 comments on commit 987417a

Please sign in to comment.