From aafc82d1c90e4ed6360c81a6ef5afa2acfef31c4 Mon Sep 17 00:00:00 2001 From: Misko Date: Thu, 19 Dec 2024 00:59:25 +0000 Subject: [PATCH] remove datasetmetadata --- src/fairchem/core/datasets/base_dataset.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/fairchem/core/datasets/base_dataset.py b/src/fairchem/core/datasets/base_dataset.py index a52abbb3b..87d5b5752 100644 --- a/src/fairchem/core/datasets/base_dataset.py +++ b/src/fairchem/core/datasets/base_dataset.py @@ -66,8 +66,6 @@ def __len__(self) -> int: return self.num_samples def metadata_hasattr(self, attr) -> bool: - if self._metadata is None: - return False return attr in self._metadata @cached_property @@ -128,7 +126,7 @@ def __init__( self, dataset: BaseDataset, indices: Sequence[int], - metadata: DatasetMetadata | None = None, + metadata: dict[str, ArrayLike], ) -> None: super().__init__(dataset, indices) self.metadata = metadata @@ -137,7 +135,7 @@ def __init__( self.config = dataset.config @cached_property - def _metadata(self) -> DatasetMetadata: + def _metadata(self) -> dict[str, ArrayLike]: return self.dataset._metadata def get_metadata(self, attr, idx):