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

ChainReader cannot be pickled #1940

Closed
orbeckst opened this issue Jun 15, 2018 · 1 comment
Closed

ChainReader cannot be pickled #1940

orbeckst opened this issue Jun 15, 2018 · 1 comment
Labels

Comments

@orbeckst
Copy link
Member

orbeckst commented Jun 15, 2018

Expected behaviour

ChainReader can be pickled like all the other Readers.

EDIT: not all readers can be pickled...

Actual behaviour

Raises TypeError because it contains a generator object

TypeError: can't pickle generator objects

See MDAnalysis/pmda#44

Code to reproduce the behaviour

import MDAnalysis as mda
import pickle

from MDAnalysis.tests.datafiles import TPR, XTC

u = mda.Universe(TPR, 3*[XTC])

s = pickle.dumps(u.trajectory, protocol=pickle.HIGHEST_PROTOCOL)

Currently version of MDAnalysis:

(run python -c "import MDAnalysis as mda; print(mda.__version__)")
0.18.1-dev

orbeckst added a commit that referenced this issue Jun 18, 2018
- all readers
- ChainReader (special case)
orbeckst added a commit that referenced this issue Jul 11, 2018
- all readers
- ChainReader (special case)
@orbeckst orbeckst added the Format-ChainReader ChainReader virtual trajectory reader label Aug 25, 2019
@orbeckst
Copy link
Member Author

orbeckst commented Aug 8, 2020

closed with PR #2723

@orbeckst orbeckst closed this as completed Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant