Skip to content

Commit

Permalink
Skip daily processing if no files present
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Nov 27, 2024
1 parent b198eaf commit 9c52deb
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/pyaro_readers/eeareader/EEATimeseriesReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,20 +504,24 @@ def _read(
sorted([(freq, c) for c in countrypaths], key=lambda x: x[1])
)

hourly_paths = [p[1] for p in paths if p[0] == "hourly"]
hourly_dataset = _read_hourly_files(
[p[1] for p in paths if p[0] == "hourly"],
hourly_paths,
variable_id,
self._metadata,
filters,
)
daily_dataset = _read_daily_files(
[p[1] for p in paths if p[0] == "daily"],
variable_id,
self._metadata,
filters,
)

dataset = hourly_dataset.vstack(daily_dataset)
daily_paths = [p[1] for p in paths if p[0] == "daily"]
if len(daily_paths) == 0:
dataset = hourly_dataset
else:
daily_dataset = _read_daily_files(
daily_paths,
variable_id,
self._metadata,
filters,
)
dataset = hourly_dataset.vstack(daily_dataset)

extra_filters = []
if self._station_area != ["all"]:
Expand Down

0 comments on commit 9c52deb

Please sign in to comment.