Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 07db836

Browse files
committed
open DataSource
1 parent 72e39c8 commit 07db836

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nowcasting_dataset/data_sources/data_source.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def create_batches(
133133
) -> None:
134134
"""Create multiple batches and save them to disk.
135135
136+
Safe to call from worker processes.
137+
136138
Args:
137139
spatial_and_temporal_locations_of_each_example: A DataFrame where each row specifies
138140
the spatial and temporal location of an example. The number of rows must be
@@ -153,6 +155,8 @@ def create_batches(
153155
assert len(spatial_and_temporal_locations_of_each_example) % batch_size == 0
154156
assert upload_every_n_batches >= 0
155157

158+
self.open()
159+
156160
# Figure out where to write batches to:
157161
save_batches_locally_and_upload = upload_every_n_batches > 0
158162
if save_batches_locally_and_upload:

0 commit comments

Comments
 (0)