Skip to content

Commit

Permalink
throw error when metadata is non integer
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Sep 18, 2024
1 parent 8226618 commit 81ea05a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fairchem/core/datasets/base_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def _metadata(self) -> DatasetMetadata:
for field in DatasetMetadata._fields
}
)

assert np.issubdtype(
metadata.natoms.dtype, np.integer
), f"Metadata natoms must be an integer type! not {metadata.natoms.dtype}"
assert metadata.natoms.shape[0] == len(
self
), "Loaded metadata and dataset size mismatch."
Expand Down

0 comments on commit 81ea05a

Please sign in to comment.