Skip to content
Snippets Groups Projects
Commit f7808a16 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

Merge branch...

Merge branch 'felix_issue287_tech-wrf-datahandler-should-inherit-from-singlestationdatahandler' of ssh://gitlab.version.fz-juelich.de:10022/esde/machine-learning/mlair into felix_issue287_tech-wrf-datahandler-should-inherit-from-singlestationdatahandler
parents 8d2bcaaf f9d79d83
No related branches found
No related tags found
1 merge request!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
......@@ -130,7 +130,9 @@ class BaseWrfChemDataLoader:
@property
def dataset_search_str(self):
if (self.start_time is None) and (self.end_time is None):
return os.path.join(self.data_path, self.common_file_starter + '*')
path_list = os.path.join(self.data_path, self.common_file_starter + '*')
logging.info(f"Reading file(s): {list(path_list)}")
return path_list
elif (self.start_time is not None) and (self.end_time is not None):
path_list = set()
for day in pd.date_range(self.start_time, self.end_time):
......@@ -138,7 +140,7 @@ class BaseWrfChemDataLoader:
self.common_file_starter) + '*' + day.strftime(
self.date_format_of_nc_file) + '*'
))[0])
logging.info(f"Reading file(s): {list(path_list)}")
return list(path_list)
else:
raise ValueError(f"`start_time' and `end_time' must both be given or None.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment