MDAnalysis / pmda

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

Issue with AnalysisFromFunction() when reading Amber .nc trajectory files #119

Open luponzo86 opened 4 years ago

luponzo86 commented 4 years ago

Expected behaviour

reading frames from a trajectory imported by MDAnalysis from a .nc file

Actual behaviour

TypeError: cannot serialize '_io.BufferedReader' object

Code to reproduce the behaviour

import MDAnalysis as mda
u = mda.Universe("example.pdb", "example.nc") 

def test(ag):
    return len(ag)

from pmda.custom import AnalysisFromFunction

analysis = AnalysisFromFunction(
    calc_PLEC_on_frame,
    u, 
    u.atoms, 
).run(n_jobs=3)

Currently version of MDAnalysis:

import MDAnalysis as mda; print(mda.__version__) 0.20.1

import pmda; print(pmda.__version__) 0.3.0

import dask; print(dask.__version__) 2.9.2

orbeckst commented 4 years ago

Thanks for the feedback.

In MDAnalysis itself we're currently working on improving serialization support (eg PR https://github.com/MDAnalysis/mdanalysis/pull/2704) so when those efforts are merged, PMDA should also be able to make use of NC files.

luponzo86 commented 4 years ago

Thank you!

orbeckst commented 3 years ago

Btw, this might work with the MDA 2.0.0 code that @yuxuanzhuang is testing in PR #132 .