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

Add GSD Logger and Pressure Tensor #53

Merged
merged 4 commits into from
Sep 19, 2023
Merged

Add GSD Logger and Pressure Tensor #53

merged 4 commits into from
Sep 19, 2023

Conversation

chrisjonesBSU
Copy link
Member

This PR sets up a separate logger for the GSD writer and logs energy, thermodynamic quantities and the pressure tensor to the GSD file.

logger.add(thermo_props, quantities=self.log_quantities)

for f in self._forcefield:
logger.add(f, quantities=["energy"])
gsd_logger.add(f, quantities=["energy"])
Copy link
Member Author

Choose a reason for hiding this comment

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

@marjanAlbouye if I add "force" to this list, will that log the average forces (not per-particle forces) just like it does for energy?

Copy link
Collaborator

@marjanalbooyeh marjanalbooyeh left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you Chris.

Maybe adding a relevant unit test that checks whether all the intended values are logged could be helpful here.

We can access the logged values from a frame of gsd like this:

gsd_traj = gsd.hoomd.open("trajectory.gsd", "rb")
frame = gsd_traj[0]
logged_keys = frame.log.keys()

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #53 (c78ede2) into main (96809e9) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   93.83%   93.85%   +0.01%     
==========================================
  Files          18       18              
  Lines        1347     1351       +4     
==========================================
+ Hits         1264     1268       +4     
  Misses         83       83              
Files Changed Coverage Δ
hoomd_organics/base/simulation.py 92.06% <100.00%> (+0.10%) ⬆️

Copy link
Collaborator

@marjanalbooyeh marjanalbooyeh left a comment

Choose a reason for hiding this comment

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

Looks great

@chrisjonesBSU chrisjonesBSU merged commit f81288a into cmelab:main Sep 19, 2023
3 checks passed
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.

2 participants