-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from molpopgen/binary_format_compatibility
Binary format compatibility fixes and tests.
- Loading branch information
Showing
8 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import unittest | ||
import fwdpy11 | ||
import pickle | ||
import lzma | ||
|
||
|
||
class TestOldBinaryFileFormats(unittest.TestCase): | ||
def test_reading_045(self): | ||
pop = fwdpy11.DiploidPopulation.load_from_file("tests/v045.bin") | ||
for i in pop.tables.mutations: | ||
self.assertEqual( | ||
pop.mutations[i.key].pos, pop.tables.sites[i.site].position) | ||
|
||
def test_unpickling_045(self): | ||
with lzma.open('tests/v045.lzma', 'rb') as f: | ||
pop = pickle.load(f) | ||
for i in pop.tables.mutations: | ||
self.assertEqual( | ||
pop.mutations[i.key].pos, pop.tables.sites[i.site].position) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Binary file not shown.
Binary file not shown.