Skip to content

Commit

Permalink
Merge pull request #267 from bnubald/235_defensive_generate_workers
Browse files Browse the repository at this point in the history
Fixes #235 defensive generate workers
  • Loading branch information
bnubald authored May 29, 2024
2 parents 3206a74 + f9fa56c commit afcad65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions icenet/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self,
self._counts = self._config["counts"]
self._dtype = getattr(np, self._config["dtype"])
self._loader_config = self._config["loader_config"]
self._generate_workers = self._config["generate_workers"]
self._generate_workers = self._config.get("generate_workers", 4)
self._n_forecast_days = self._config["n_forecast_days"]
self._num_channels = self._config["num_channels"]
self._shape = tuple(self._config["shape"])
Expand Down Expand Up @@ -148,7 +148,7 @@ def get_data_loader(self,
if n_forecast_days is None:
n_forecast_days = self._config["n_forecast_days"]
if generate_workers is None:
generate_workers = self._config["generate_workers"]
generate_workers = self._config.get("generate_workers", 4)
loader = IceNetDataLoaderFactory().create_data_loader(
"dask", # This will load the `DaskMultiWorkerLoader` class.
self.loader_config,
Expand Down

0 comments on commit afcad65

Please sign in to comment.