MDAnalysis / pmda

Parallel algorithms for MDAnalysis
https://www.mdanalysis.org/pmda/
Other
31 stars 22 forks source link

np.hstack should not be used in _conclude #140

Closed yuxuanzhuang closed 4 years ago

yuxuanzhuang commented 4 years ago

Expected behaviour

self._results should be reshaped into a sensible new variable with different n_blocks.

Actual behaviour

if using np.hstack, self._results have to be in the same dimensions.

Code to reproduce the behaviour

from pmda.contacts import Contacts

universe = mda.Universe(PSF, DCD)
sel_basic = "(resname ARG LYS) and (name NH* NZ)"
sel_acidic = "(resname ASP GLU) and (name OE* OD*)"
acidic = universe.select_atoms(sel_acidic)
basic = universe.select_atoms(sel_basic)

ana1 = Contacts((acidic, basic), (acidic, basic), radius=6.0)

ana1.run(n_blocks=3)

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 33 and the array at index 2 has size 32

Fix

Sidenote

It seems that this error has been raised multiple times. I guess we should

Currently version of MDAnalysis:

(run python -c "import MDAnalysis as mda; print(mda.__version__)") 2.0.0-dev (run python -c "import pmda; print(pmda.__version__)") '0.3.0+17.g13fa3b5.dirty' (run python -c "import dask; print(dask.__version__)") 2.19.0