Skip to content

Fix ts unpickling #1298

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

Merged
merged 1 commit into from
Apr 7, 2021
Merged

Fix ts unpickling #1298

merged 1 commit into from
Apr 7, 2021

Conversation

benjeffery
Copy link
Member

Fixes #1297

@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #1298 (f09d404) into main (f277006) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1298   +/-   ##
=======================================
  Coverage   93.81%   93.81%           
=======================================
  Files          26       26           
  Lines       22187    22187           
  Branches     1006     1006           
=======================================
  Hits        20814    20814           
  Misses       1340     1340           
  Partials       33       33           
Flag Coverage Δ
c-tests 92.44% <ø> (ø)
lwt-tests 92.97% <ø> (ø)
python-c-tests 95.14% <100.00%> (ø)
python-tests 98.86% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/tskit/trees.py 97.90% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f277006...f09d404. Read the comment docs.

Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ts = pickle.loads(pickle.dumps(ts_fixture, protocol=protocol))
assert ts.tables == ts_fixture.tables
# Do some thing to check the ts is init'd properly
ts.draw_text()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be quite an expensive thing to do, maybe something like assert ts.num_trees == len(list(ts.trees()))?

Copy link
Member Author

@benjeffery benjeffery Apr 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't trigger the error unfortunately. The example ts is fixed and takes 40ms to run the current test on my box:

0.04s call     tests/test_highlevel.py::test_pickle_round_trip
0.01s setup    tests/test_highlevel.py::test_pickle_round_trip
0.00s teardown tests/test_highlevel.py::test_pickle_round_trip

@mergify mergify bot merged commit 833ffc8 into tskit-dev:main Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't pickle then unpickle a tree sequence: "no attribute '_table_metadata_schemas'"
2 participants