Closed orionarcher closed 2 years ago
Merging #72 (8190698) into main (e25c72c) will not change coverage. The diff coverage is
n/a
.:exclamation: Current head 8190698 differs from pull request most recent head 7fcd71e. Consider uploading reports for the commit 7fcd71e to get more accurate results
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Moved to PR #75 because I accidentally merged this.
Description
This PR was split off from PR #70 to better separate quality-of-life changes from API changes. See that PR for some history and discussion.
This is intended to be a major PR to handle multi-atom solutes. It relates to issues #47, #66, and #58.
I would like to propose the following outline of new functionality. In this description, I will focus on the outward facing API. I'll use the somewhat trivial case of water as an example.
Solution
will be renamed toSolute
. All references tosolute
in the current documentation will be renamed tosolvated atom
orsolvated atoms
. I think this better captures what theSolute
class really is, especially as we expand to multi-atomSolute
s.The default initializer for
Solute
will take only a single atom per residue. It will not support multiple identical atoms on a residue. This will be handled by the more general case. As a result, instantiating a Solute for a single atom remains the same.Solute
, these will support multi-atom solutes.The first will allow the user to stitch together multiple solutes to create a new solute.
The second will allow users to simply instantiate a solute from an entire residue (or part of a residue). There may be technical challenges here so this behavior is not guaranteed.
To support this, the
solvation_data
dataframe will have two additional columns added, a "residue" column and a "solute_name" column. All analysis classes will be refactored to operate on the "residue" column rather than the "solvated_atom" column. This will make no difference for single-atom solutes but will allow the analysis classes to generalize easily. I'm not completely sure the "solute_name" column is necessary, but it would be convenient to have.When a multi-atom solute is created all of the
solvation_data
dataframes from each constituent single-atom solute will be merged together. The "residue" column will group together solvated atoms on the same residue such that the analysis classes can operate on the whole solute. The API for accessing the residence classes will be identical.Solute
s as a property of the multi-atomSolute
. This would amount to a rough doubling of the memory footprint, but it would make follow up analysis easier. I'm a bit torn here and there may be a better way.For a single atom solute the
atoms
list would still be present but the data within would be identical to thesolvation_data
of the solute itself. Single atom solutes are now just a special case of multi-atom solutes.I'm sure there are many things I am not considering that will come up later, but as a start, I think this plan will allow the package to be generalized with maximum code reuse. I'd love feedback or suggestions on any aspect of the outline above.
Todos
Notable points that this PR has either accomplished or will accomplish.
Status