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

Improve trajectory handling for MD #886

Merged
merged 4 commits into from
Nov 22, 2023
Merged

Conversation

gpetretto
Copy link
Contributor

Following what discussed in #872, I have tried to implement an additional option for store_trajectory and to add the temperature parsed from the OSZICAR.

For the temperature, the code will attempt to parse it if store_trajectory is not False, but there are different ways of doing this. For example the temperature could have been stored in a different location in the model, or its parsing could have been activated by a new option. I preferred to keep it as minimal as possible and see if there are specific requests for emmet or atomate2 compatibility (@utf and @mjwen).

@mjwen
Copy link
Member

mjwen commented Nov 14, 2023

Thanks @gpetretto !

I've no specific request. This looks great.

@@ -618,7 +622,7 @@ def from_vasp_files(
strip_bandstructure_projections: bool = False,
strip_dos_projections: bool = False,
store_volumetric_data: Optional[Tuple[str]] = None,
store_trajectory: bool = False,
store_trajectory: Union[bool, str] = False,
Copy link
Member

@munrojm munrojm Nov 14, 2023

Choose a reason for hiding this comment

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

Instead of mixing bool and str inputs to support a third "partial" option, I would vote change this to be an enum value or string representation of an enum value. That way the type and options are more well-defined. Even expecting a string and type hinting with a literal would work well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I switched to the Enum. Passing the string value is also fine. Let me know if you have other suggestions or better naming conventions.

Copy link
Member

Choose a reason for hiding this comment

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

Looks fine to me, let me know when you are happy to have it merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it is fine, you can proceed to merge. Thanks!

@munrojm
Copy link
Member

munrojm commented Nov 14, 2023

This looks great! Posted one comment, but I think this is a nice addition.

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (1264493) 78.91% compared to head (79dd028) 91.20%.
Report is 56 commits behind head on main.

Files Patch % Lines
emmet-core/emmet/core/vasp/calculation.py 48.14% 14 Missing ⚠️
emmet-core/emmet/core/tasks.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #886       +/-   ##
===========================================
+ Coverage   78.91%   91.20%   +12.29%     
===========================================
  Files          75      138       +63     
  Lines        4217    12797     +8580     
===========================================
+ Hits         3328    11672     +8344     
- Misses        889     1125      +236     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@munrojm munrojm added the release:patch Patch updates label Nov 16, 2023
@munrojm munrojm merged commit dca555c into materialsproject:main Nov 22, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:patch Patch updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants