Instead of passing data_source_names into NowcastingDataset constructor, pass instantiated DataLoader subclass objects into NowcastingDataset.
This has several advantages:
Allows us to set DataLoader.transforms easily.
Means we can get rid of the ugly data_loader.__init__.DATA_SOURCE_NAME_TO_LOADER_CLASS.
But also requires a bit more work:
Need write stub classes for all DataLoader subclasses that we want to use (because they need to know their name). But, that said, let's only implement the ones we're actually using for now :slightly_smiling_face:
The DataLoader.data_path should be optional, so it can be set after being initialised by NowcastingDataset._instantiate_data_source_loaders.
Maybe also change the name of NowcastingDataset._instantiate_data_source_loaders to something like _set_data_paths_in_data_loaders.
Instead of passing
data_source_names
intoNowcastingDataset
constructor, pass instantiatedDataLoader
subclass objects intoNowcastingDataset
.This has several advantages:
DataLoader.transforms
easily.data_loader.__init__.DATA_SOURCE_NAME_TO_LOADER_CLASS
.But also requires a bit more work:
DataLoader.data_path
should be optional, so it can be set after being initialised byNowcastingDataset._instantiate_data_source_loaders
.NowcastingDataset._instantiate_data_source_loaders
to something like_set_data_paths_in_data_loaders
.