-
Notifications
You must be signed in to change notification settings - Fork 68
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
Ensure free_energy
property is a float
and not np.array(float)
#259
Conversation
The ASE `Calculator.results` attribute of `free_energy` should be formatted as a `float` but is currently formatted as a `np.array(float)`. For instance, `array(-4.0938973, dtype=float32)`. Since this is not the expected ASE type and because it is not iterable, this can cause a variety of unexpected problems. materialsvirtuallab/monty#668 is just one example. I have ensured `free_energy` is returned as a `float` in this PR. Signed-off-by: Andrew S. Rosen <[email protected]>
WalkthroughThe recent update in the codebase primarily involves a refinement in the Changes
Recent Review DetailsConfiguration used: .coderabbit.yaml Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Out of diff range and nitpick comments (1)
src/matgl/ext/ase.py (1)
181-181
: Correctly convertsfree_energy
to a float to prevent type-related issues.Consider adding a comment explaining the use of
.item()
for clarity, especially for future maintainers.
Hi @Andrew-S-Rosen, thanks for your changes! Merged. |
Closes #2090. Waiting on: - matgl 1.1.2 (see materialsvirtuallab/matgl#259)
The
PESCalculator.results["free_energy"]
property should be formatted as afloat
but is currently formatted as anp.array(float)
. For instance,array(-4.0938973, dtype=float32)
. Since this is not the expected ASE type and because it is not iterable, this can cause a variety of unexpected problems. materialsvirtuallab/monty#668 is just one example.I have ensured the
free_energy
property is returned as afloat
in this PR.