Commit f549f767 authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

add clearer exception

parent a60d02fe
No related merge requests found
Showing with 1 addition and 0 deletions
+1 -0
...@@ -311,6 +311,7 @@ class AbstractStudy(object): ...@@ -311,6 +311,7 @@ class AbstractStudy(object):
def ordered_years_and_path_files(self): def ordered_years_and_path_files(self):
nc_files = [(int(f.split('_')[-2][:4]) + 1, f) for f in os.listdir(self.study_full_path) if f.endswith('.nc')] nc_files = [(int(f.split('_')[-2][:4]) + 1, f) for f in os.listdir(self.study_full_path) if f.endswith('.nc')]
assert op.exists(self.study_full_path) assert op.exists(self.study_full_path)
assert len(nc_files) > 0
ordered_years, path_files = zip(*[(year, op.join(self.study_full_path, nc_file)) ordered_years, path_files = zip(*[(year, op.join(self.study_full_path, nc_file))
for year, nc_file in sorted(nc_files, key=lambda t: t[0]) for year, nc_file in sorted(nc_files, key=lambda t: t[0])
if (self.year_min <= year <= self.year_max) if (self.year_min <= year <= self.year_max)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment