Skip to content

Commit 986d92a

Browse files
Fix featurizer atomic types (#46)
* Get atomic_types through capabilities * Add test * Fix version to 1.1.0
1 parent 6d8f9e9 commit 986d92a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/pet_mad/explore/_featurizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __init__(
106106
cache_dir=cache_dir,
107107
)
108108

109-
petmad = get_pet_mad(version="latest", checkpoint_path=pet_checkpoint_path)
109+
petmad = get_pet_mad(version="1.1.0", checkpoint_path=pet_checkpoint_path)
110110

111111
explorer = MADExplorer(petmad.module, device=device)
112112
explorer.load_checkpoint(petmad_explorer_path)

tests/pet_mad/test_featurizer.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import numpy as np
2+
from ase.build import bulk
3+
4+
from pet_mad.explore import PETMADFeaturizer
5+
6+
7+
def test_basic_usage():
8+
atoms = bulk("Si", cubic=True, a=5.43, crystalstructure="diamond")
9+
featurizer = PETMADFeaturizer("latest")
10+
feats = featurizer([atoms], None)
11+
assert isinstance(feats, np.ndarray)

0 commit comments

Comments
 (0)