Skip to content

Commit

Permalink
Fix data directory in test
Browse files Browse the repository at this point in the history
  • Loading branch information
frostedoyster committed Nov 30, 2023
1 parent 366f39c commit 4cca96c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import torch

from metatensor_models.utils.data import Dataset, collate_fn, read_structures, read_targets
Expand All @@ -6,8 +7,10 @@
def test_dataset():
"""Tests the readers and the dataset class."""

structures = read_structures("data/qm9_reduced_100.xyz")
targets = read_targets("data/qm9_reduced_100.xyz", "U0")
dataset_path = os.path.join(os.path.dirname(__file__), "data/qm9_reduced_100.xyz")

structures = read_structures(dataset_path)
targets = read_targets(dataset_path, "U0")

dataset = Dataset(structures, targets)
dataloader = torch.utils.data.DataLoader(dataset, batch_size=10, collate_fn=collate_fn)
Expand Down

0 comments on commit 4cca96c

Please sign in to comment.