Skip to content

Different methods of creating TopologyGroups give different results #2392

@lilyminium

Description

@lilyminium

Expected behavior

Creating a TopologyGroup with TopologyGroup.__init__ gives the same result as Universe.add_TopologyAttr.

Actual behavior

Properties such as type, guessed, order, are reshaped and become array values.

Code to reproduce the behavior

Show us how to reproduce the failiure. If you can, use trajectory files from the test data.

In [58]: import MDAnalysis as mda
In [59]: from MDAnalysis.tests.datafiles import PSF

In [60]: psf = mda.Universe(PSF)

In [61]: psf.bonds._bondtypes
Out[61]: array([None, None, None, ..., None, None, None], dtype=object)

In [62]: b = mda.core.topologyobjects.TopologyGroup(psf.bonds.indices, psf, type=None)
In [63]: b._bondtypes
Out[63]:
array([[None],
       [None],
       [None],
       ...,
       [None],
       [None],
       [None]], dtype=object)

Currently version of MDAnalysis

  • Which version are you using? (run python -c "import MDAnalysis as mda; print(mda.__version__)") 0.20.1
  • Which version of Python (python -V)? 3.7.3
  • Which operating system? MacOS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions