Closed chrisjonesBSU closed 2 years ago
Merging #46 (8e26bed) into main (f4c844b) will increase coverage by
0.11%
. The diff coverage is100.00%
.
@@ 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%) |
:arrow_up: |
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.
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
andbond.typeid
arrays once, then apply it to each snapshot after. This would be applicable to things likesnap.particles.types
andsnap.particles.typeid
andsnap.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.
This PR ensures that both
snapshot.bonds.types
andsnapshot.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)