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

Bugfix: Interactive calculation array comparison #1542

Merged
merged 2 commits into from
Jul 19, 2024
Merged

Conversation

jan-janssen
Copy link
Member

This seems to related to the recent numpy updates

jan-janssen and others added 2 commits July 19, 2024 07:13
@jan-janssen jan-janssen merged commit 110c883 into main Jul 19, 2024
25 of 26 checks passed
@jan-janssen jan-janssen deleted the interactive branch July 19, 2024 05:23
elif np.array(data).dtype == np.dtype("O"):
self._extend_hdf(h5=h5, path=path, key=key, data=data)
else:
self._extend_hdf(h5=h5, path=path, key=key, data=np.array(data))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these calls to the same function are very similar. Actually, why can the stuff from the except clause not be done here? If not a dtype=O, then construct such an array instead of a regular one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the recent numpy version np.array(data) fails, unless np.array(data, dtype="object") is set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably means that this clause elif np.array(data).dtype == np.dtype("O") is never trigger, because it raises an exception.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I am not sure. The clean way would require the user to specify if the number of atoms is going to change in their simulation or not and then choose the corresponding approach for storing the structures. So this is really just a quick fix to use interactive jobs to evaluate machine learned interatomic potentials to calculate the energies and forces for the test and training set.

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

Successfully merging this pull request may close these issues.

3 participants