Skip to content

Commit

Permalink
Return paths to existing files from service functions
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Jan 15, 2024
1 parent 91888e9 commit ef0dc6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/nwp_consumer/internal/service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def DownloadRawDataset(self, *, start: dt.date, end: dt.date) -> list[pathlib.Pa
startDate=start.strftime("%Y-%m-%d %H:%M"),
endDate=end.strftime("%Y-%m-%d %H:%M"),
)
return []
return [self.rawdir / fi.it().strftime(internal.IT_FOLDER_FMTSTR) / fi.filename() for fi in allWantedFileInfos]
else:
log.info(
event="downloading files",
Expand Down Expand Up @@ -145,7 +145,11 @@ def ConvertRawDatasetToZarr(self, *, start: dt.date, end: dt.date) -> list[pathl
startDate=start.strftime("%Y/%m/%d %H:%M"),
endDate=end.strftime("%Y/%m/%d %H:%M"),
)
return []
return [
self.zarrdir / it.strftime(f"{internal.ZARR_FMTSTR}.zarr.zip")
for it in allInitTimes
if start <= it.date() <= end
]
else:
log.info(
event=f"converting {len(desiredInitTimes)} init times to zarr.",
Expand Down

0 comments on commit ef0dc6e

Please sign in to comment.