Skip to content

Commit

Permalink
refactor: now calling the predict method in ase generally
Browse files Browse the repository at this point in the history
  • Loading branch information
laserkelvin committed Jun 3, 2024
1 parent d3a1efc commit ca3b8a8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions matsciml/interfaces/ase/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,12 @@ def calculate(
# get into format ready for matsciml model
data_dict = self._format_pipeline(atoms)
# run the data structure through the model
output = self.task_module.predict(data_dict)
if isinstance(self.task_module, MultiTaskLitModule):
output = self.task_module.ase_calculate(data_dict)
# use a more complicated parser for multitasks
results = self.multitask_strategy(output, self.task_module)
self.results = results
else:
# use the specialized predict method, which will rescale data
output = self.task_module.predict(data_dict)
# add outputs to self.results as expected by ase
if "energy" in output:
self.results["energy"] = output["energy"].detach().item()
Expand Down

0 comments on commit ca3b8a8

Please sign in to comment.