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

Fix Merge for issue-363 branch #781

Merged
merged 4 commits into from
Apr 10, 2016
Merged

Fix Merge for issue-363 branch #781

merged 4 commits into from
Apr 10, 2016

Commits on Mar 18, 2016

  1. Fix Merge for issue-363 branch

    Rewrote mda.Merge to work for new topology style.
    
    I also changed the default argument for attrs in core.Topology() beacuse
    the default argument of None caused an error, whereas using an empty
    list instead will return a blank Topology.
    khuston committed Mar 18, 2016
    Configuration menu
    Copy the full SHA
    36bbbc2 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2016

  1. fix atomgrps for same universe, enable sum

    My first attempt at collecting atom groups for the same universe was
    flawed if args contained more than one atom group from the same
    universe. Hopefully this one is correct.
    
    I also override __rsum__ on AtomGroups to allow use of sum.
    khuston committed Mar 19, 2016
    Configuration menu
    Copy the full SHA
    f34db5a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    44f39f3 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2016

  1. correct Merge atom order, segind, add top tests

    I changed my previously proposed mda.Merge to align more closely with
    the old Merge behavior, in that it preserves the atom order as given to
    Merge. Given the introduction of residue and segment indices (distinct
    from ids), the behavior of this new Merge assigns separate residue and
    segment indices to each argument of Merge. That is, if two arguments to
    merge are atomgroups from the same universe with the same residue
    indices, in the post-merge universe, they will have different residue
    indices. If the user doesn't want this, s/he should add together the
    atom groups before merging.
    
    My understanding is that resid is just an attribute of a residue,
    whereas the residue index is the unique identifier of that residue
    instance. I didn't think it would make much sense for Merge to duplicate
    atoms by giving them different indices while keeping their residue
    indices the same, such that you have doubled or tripled (etc.) the
    number of atoms in a residue or segment.
    
    Before I was sending the per-atom segment indices to Topology instead of
    the per-residue segment indices. Topology.__init__() or
    TransTable.__init__() should probably check that the correct length
    index arrays are passed on.
    
    I added an attribute to the TopologyAttrs called `per_object` where the
    value of this attribute is 'atom', 'residue', or 'segment' if the length
    of the TopologyAttr value should equal n_atoms, n_residues, or
    n_segments. The Universe method `_process_attr` now checks if the
    TopologyAttr has `per_object` attribute, and raises a ValueError of the
    length of the value array is not as expected.
    
    Finally I updated `test_modelling.py`. This actually increased the
    number of errors raised during testing by 2, because instead of stopping
    at an error in the first few lines of the test file, it goes on and
    errors occur for Capping and `atoms.write`.
    khuston committed Mar 22, 2016
    Configuration menu
    Copy the full SHA
    c898852 View commit details
    Browse the repository at this point in the history