Skip to content

Commit

Permalink
Merge pull request #7 from ecmwf-projects/more-cuon-fixes
Browse files Browse the repository at this point in the history
more CUON fixes
  • Loading branch information
aperezpredictia authored Feb 23, 2024
2 parents 4678f4d + cfe8cd9 commit 8ef907f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions cdsobs/ingestion/readers/cuon.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ def read_cuon_netcdfs(
else:
# Do not use threads as HDF5 is not yet thread safe.
scheduler = "processes"
# Check for emptiness
if len(files_and_slices) == 0:
raise EmptyBatchException
# Use dask to speed up the process
for file_and_slices in files_and_slices:
denormalized_table_future = dask.delayed(_get_denormalized_table_file)(
Expand All @@ -284,6 +287,9 @@ def read_cuon_netcdfs(
scheduler=scheduler,
num_workers=min(len(files_and_slices), 32),
)
# Check for emptiness
if all([dt is None for dt in denormalized_tables]):
raise EmptyBatchException
return pandas.concat(denormalized_tables)


Expand Down

0 comments on commit 8ef907f

Please sign in to comment.