Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

AIMNet2ASE returns the energy as a numpy.array #44

@kangmg

Description

@kangmg

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! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions