-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
logger.add(thermo_props, quantities=self.log_quantities) | ||
|
||
for f in self._forcefield: | ||
logger.add(f, quantities=["energy"]) | ||
gsd_logger.add(f, quantities=["energy"]) |
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.
@marjanAlbouye if I add "force"
to this list, will that log the average forces (not per-particle forces) just like it does for energy?
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.
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 Report
Additional details and impacted files@@ 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
|
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.
Looks great
This PR sets up a separate logger for the GSD writer and logs energy, thermodynamic quantities and the pressure tensor to the GSD file.