Pass datamodule kwargs to datasets #666
Labels
backwards-incompatible
Changes that are not backwards compatible
datamodules
PyTorch Lightning datamodules
Milestone
Summary
We should remove dataset-specific arguments from datamodules and instead pass them directly to the dataset through kwargs.
Rationale
As an example, we'll look at
TropicalCycloneWindEstimation
andCycloneDataModule
.TropicalCycloneWindEstimation
has a number of options that users may want to configure:However,
CycloneDataModule
only exposes a subset of these:If a user wants to, for example, automatically download the dataset, they have to modify the source code of
CycloneDataModule
. If we instead pass the**kwargs
fromCycloneDataModule
directly toTropicalCycloneWindEstimation
, we end up with less code duplication, more features, and greater consistency.Implementation
Here is what the change would look like for
CycloneDataModule
:This should be done for all other datamodules.
Alternatives
The alternative is to add new parameters to each datamodule as we need them. This results in an inconsistent API.
Additional information
No response
The text was updated successfully, but these errors were encountered: