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

TableCollection pickle not passing valid tree sequence #574

Closed
jeromekelleher opened this issue Aug 15, 2018 · 4 comments
Closed

TableCollection pickle not passing valid tree sequence #574

jeromekelleher opened this issue Aug 15, 2018 · 4 comments
Labels
Milestone

Comments

@jeromekelleher
Copy link
Member

Some issue with round tripping TableCollections through pickle:

import msprime
import pickle

ts = msprime.simulate(10, random_seed=2)
x = pickle.dumps(ts.tables)
tables = pickle.loads(x)
# tables is OK
ts = t2.tree_sequence() # Fails

Thanks to @molpopgen for pointing it out.

@jeromekelleher jeromekelleher added this to the Release 0.6.1 milestone Aug 15, 2018
@molpopgen
Copy link
Member

I get a different error. I just pip3 install --upgrade msprime a few minutes ago.

import msprime
import pickle

ts = msprime.simulate(10,mutation_rate=10,recombination_rate=10)
p = pickle.dumps(ts.tables)
python3 pickle_tables.py 
Traceback (most recent call last):
  File "pickle_tables.py", line 5, in <module>
    p = pickle.dumps(ts.tables)
TypeError: can't pickle _msprime.TableCollection objects

jeromekelleher added a commit to mcveanlab/msprime that referenced this issue Aug 15, 2018
@jeromekelleher
Copy link
Member Author

Yes, that makes much more sense, basically pickle wasn't implemented at all. I'm guessing you're on a newer version of Python than me, which gives a better error.

@jeromekelleher
Copy link
Member Author

I'm implementing over in #577. Should be released in a week or so.

@molpopgen
Copy link
Member

I'm on 3.6.5.

jeromekelleher added a commit to mcveanlab/msprime that referenced this issue Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants