diff --git a/lambench/metrics/vishelper/metrics_calculations.py b/lambench/metrics/vishelper/metrics_calculations.py index 2c8e515..ddea233 100644 --- a/lambench/metrics/vishelper/metrics_calculations.py +++ b/lambench/metrics/vishelper/metrics_calculations.py @@ -159,7 +159,9 @@ def calculate_generalizability_downstream_score(self) -> tuple[dict, dict]: ) # drop models with missing domain results # # Now aggregate all domains to get the final generalizability metrics for each model - return domain_results.to_dict(orient="index"), domain_results.mean(axis=1).to_dict() + return domain_results.to_dict(orient="index"), domain_results.mean( + axis=1 + ).to_dict() def calculate_stability_results(self) -> dict[str, float]: """This calculates the stability score for a given LAM.""" diff --git a/lambench/tasks/calculator/elastic/elastic.py b/lambench/tasks/calculator/elastic/elastic.py index be4f01e..e0c0c51 100644 --- a/lambench/tasks/calculator/elastic/elastic.py +++ b/lambench/tasks/calculator/elastic/elastic.py @@ -102,9 +102,10 @@ def get_elastic_for_one( """ atoms = read(StringIO(atom_info["poscar"]), format="vasp") + calc = model.calc relaxed_atoms = model.run_ase_relaxation( atoms=atoms, - calc=model.calc, + calc=calc, fmax=fmax, steps=max_steps, fix_symmetry=False, @@ -119,7 +120,7 @@ def get_elastic_for_one( stresses = [] for deformed_structure in deformed_structure_set: atoms = deformed_structure.to_ase_atoms() - atoms.calc = model.calc + atoms.calc = calc stresses.append(atoms.get_stress(voigt=False)) strains = [ diff --git a/lambench/tasks/calculator/torsionnet/torsionnet.py b/lambench/tasks/calculator/torsionnet/torsionnet.py index 4d11de9..3a91eda 100644 --- a/lambench/tasks/calculator/torsionnet/torsionnet.py +++ b/lambench/tasks/calculator/torsionnet/torsionnet.py @@ -30,6 +30,8 @@ def run_torsionnet( result = {} # predicted energy label = {} # label energy + calc = model.calc + # 500 fragments from Torsionnet500 dataset for fragment in tqdm(test_data.iterdir()): if not fragment.is_dir(): @@ -40,7 +42,7 @@ def run_torsionnet( for frame in dpdata.LabeledSystem(file_name=fragment, fmt="deepmd/raw"): assert len(frame) == 1 atoms: Atoms = frame.to_ase_structure()[0] # type: ignore - atoms.calc = model.calc + atoms.calc = calc pred_energy = atoms.get_potential_energy() * 23.0609 # eV to kcal/mol result[fragment.name].append(pred_energy) label_energy = frame.data["energies"][0]