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

Populate snapshot.bonds.types and snapshot.bonds.typeid #46

Merged
merged 8 commits into from
Jul 22, 2022
Merged

Populate snapshot.bonds.types and snapshot.bonds.typeid #46

merged 8 commits into from
Jul 22, 2022

Conversation

chrisjonesBSU
Copy link
Member

This PR ensures that both snapshot.bonds.types and snapshot.bonds.typeid are populated. All of the work to identify bonds is pretty much done, this just iterates through the existing information to populate these fields of the snapshot.

So far it seems to work on a simple system (PEKK) where there are 2 kinds of beads. I sitll need to add unit tests and try it out a system that has some kind of branching (p3ht)

@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #46 (8e26bed) into main (f4c844b) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   96.50%   96.62%   +0.11%     
==========================================
  Files           4        4              
  Lines         372      385      +13     
==========================================
+ Hits          359      372      +13     
  Misses         13       13              
Impacted Files Coverage Δ
grits/coarsegrain.py 98.19% <100.00%> (+0.11%) ⬆️

@chrisjonesBSU chrisjonesBSU removed the WIP label Jul 14, 2022
@chrisjonesBSU
Copy link
Member Author

chrisjonesBSU commented Jul 15, 2022

Now that I'm thinking about this some more, if the bonds aren't changing throughout the trajectory (which is probably safe to assume), we only have to create the bond.groups, bond.types and bond.typeid arrays once, then apply it to each snapshot after. This would be applicable to things like snap.particles.types and snap.particles.typeid and snap.particles.mass if the numbers and types of particles isn't changing either.

It seems pretty fast now, so I'm not sure if it's better to be safe (don't assume bonds and particles are constant) rather than try to improve performance.

@chrisjonesBSU
Copy link
Member Author

Now that I'm thinking about this some more, if the bonds aren't changing throughout the trajectory (which is probably safe to assume), we only have to create the bond.groups, bond.types and bond.typeid arrays once, then apply it to each snapshot after. This would be applicable to things like snap.particles.types and snap.particles.typeid and snap.particles.mass if the numbers and types of particles isn't changing either.

It seems pretty fast now, so I'm not sure if it's better to be safe (don't assume bonds and particles are constant) rather than try to improve performance.

Actually, I don't think GRiTS would really work as is if the bonds and particle types were changing. These attributes are set based on the first frame only and used over again when coarse-graining the trajectory.

@chrisjonesBSU chrisjonesBSU merged commit 9a5dc8d into cmelab:main Jul 22, 2022
@chrisjonesBSU chrisjonesBSU deleted the fix/bonds branch July 22, 2022 20:58
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.

1 participant