Skip to content

Commit

Permalink
Revert "Simplify FloatCastDatasetWrapper"
Browse files Browse the repository at this point in the history
This reverts commit 7726350.
  • Loading branch information
RaulPPelaez committed Jan 31, 2024
1 parent 36e080e commit 9158022
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion torchmdnet/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ def get(self, idx):
return data

def __getattr__(self, name):
return getattr(self.dataset, name)
# Check if the attribute exists in the underlying dataset
if hasattr(self.dataset, name):
return getattr(self.dataset, name)
raise AttributeError(
f"'{type(self).__name__}' and its underlying dataset have no attribute '{name}'"
)


class DataModule(LightningDataModule):
Expand Down

0 comments on commit 9158022

Please sign in to comment.