From 2e229c3dc2f2bda617284775106b525bef4840ff Mon Sep 17 00:00:00 2001 From: David Huard Date: Thu, 8 Apr 2021 17:36:06 -0400 Subject: [PATCH] use startswith to check suffix is nc --- ravenpy/models/importers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ravenpy/models/importers.py b/ravenpy/models/importers.py index cee757b8..64933764 100644 --- a/ravenpy/models/importers.py +++ b/ravenpy/models/importers.py @@ -781,7 +781,7 @@ def __init__(self, fns): def _extract_nc_attrs(self, fns): for fn in fns: - if ".nc" in Path(fn).suffix: + if Path(fn).suffix.startswith(".nc"): with xr.open_dataset(fn) as ds: # Check if any alternate variable name is in the file. for var, alt_names in rv.alternate_nc_names.items():