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

AIMNet2ASE returns the energy as a numpy.array #44

Open
kangmg opened this issue Nov 19, 2024 · 1 comment
Open

AIMNet2ASE returns the energy as a numpy.array #44

kangmg opened this issue Nov 19, 2024 · 1 comment

Comments

@kangmg
Copy link

kangmg commented Nov 19, 2024

Hi,

Here’s a simple issue.

The result of get_potential_energy() should be a float, but it is currently returning a numpy.array.

from ase.build import molecule
from aimnet2calc import AIMNet2ASE

atoms = molecule('H2O')
atoms.calc = AIMNet2ASE(base_calc='aimnet2_wb97m_0.jpt')
e = atoms.get_potential_energy()
print(e)
# array([-2081.04087209])

It seems that .item() was missing here as well:

        self.results['energy'] = results['energy'].item()

Thank you! :)

@corinwagen
Copy link

agreed here! this upsets MyPy and causes downstream issues

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

No branches or pull requests

2 participants