Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing __all__ attribute to priors #149

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/test_priors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytorch_lightning as pl
from torchmdnet import models
from torchmdnet.models.model import create_model
from torchmdnet import priors
from torchmdnet.priors import Atomref
from torch_scatter import scatter
from utils import load_example_args, create_example_batch, DummyDataset
Expand Down Expand Up @@ -31,3 +32,10 @@ def test_atomref(model_name):
# check if the output of both models differs by the expected atomref contribution
expected_offset = scatter(dataset.get_atomref().squeeze()[z], batch).unsqueeze(1)
torch.testing.assert_allclose(x_atomref, x_no_atomref + expected_offset)


def test_prior_list():
# make sure the priors submodule defines the __all__ attribute
assert hasattr(priors, "__all__")
# make sure it's not empty
assert len(priors.__all__) > 0
2 changes: 2 additions & 0 deletions torchmdnet/priors/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from torchmdnet.priors.atomref import Atomref

__all__ = ["Atomref"]