Skip to content

Commit ea8664f

Browse files
update hdf5 dataset (#292)
update hdf5 dataset such that now charges, spin and partial charges can be included at the same time. also, renamed partial charges to 'pq' to be consistent with other datasets such as Ace
1 parent 166b7db commit ea8664f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

torchmdnet/datasets/hdf.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ def __init__(self, filename, dataset_preload_limit=1024, **kwargs):
5353
self.fields.append(("y", "energy", torch.float32))
5454
if "forces" in group:
5555
self.fields.append(("neg_dy", "forces", torch.float32))
56+
if "charge" in group:
57+
self.fields.append(("q", "charge", torch.float32))
58+
if "spin" in group:
59+
self.fields.append(("s", "spin", torch.float32))
5660
if "partial_charges" in group:
5761
self.fields.append(
58-
("partial_charges", "partial_charges", torch.float32)
62+
("pq", "partial_charges", torch.float32)
5963
)
6064
assert ("energy" in group) or (
6165
"forces" in group

0 commit comments

Comments
 (0)