Skip to content

fixed bug in dataset tests - #791

Open
jnsLs wants to merge 2 commits into
devfrom
jl/data_test_fix
Open

fixed bug in dataset tests#791
jnsLs wants to merge 2 commits into
devfrom
jl/data_test_fix

Conversation

@jnsLs

@jnsLs jnsLs commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

PR #781 broke the dataset tests. this PR fixes the latent bug

Copilot AI lite review requested due to automatic review settings August 11, 2026 13:03
@jnsLs
jnsLs requested a review from stefaanhessmann August 11, 2026 13:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates local-only dataset tests to match the post-#781 dataset/datamodule API (construct dataset instances directly, then wrap them in AtomsDataModule and run setup()), while isolating split artifacts in a temporary working directory.

Changes:

  • Refactor QM9/MD17/rMD17 tests to use AtomsDataModule(dataset, ...) instead of passing dataset-specific args into dataset constructors/datamodules inconsistently.
  • Write split files into tmp_path and call setup() to populate train/val/test subsets and dataloaders.
Suppressed comments (1)

tests/data/test_datasets.py:55

  • Same CWD/path interaction as in test_qm9: changing the working directory before resolving test_md17_path can make a relative path point to the wrong location. Resolve the DB path to absolute before chdir() and pass that to MD17.
def test_md17(test_md17_path, tmp_path, monkeypatch):
    monkeypatch.chdir(tmp_path)
    dataset = MD17(test_md17_path, molecule="uracil")
    md17 = AtomsDataModule(

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/data/test_datasets.py
Comment thread tests/data/test_datasets.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants