replicahq / doppelganger

A Python package of tools to support population synthesizers
Apache License 2.0
165 stars 32 forks source link

Python 3 Compatibility #22

Closed ahardjasa closed 7 years ago

ahardjasa commented 7 years ago

Some small edits so that the package will be compatible with Python 3 (to close #20), using builtins from future .

The fix for mocking open is a little ugly but I tried a few different things and had little success.

test_load_bayes_net was failing in Python 3 due to the third tuple sorting as (1, 0) instead of (0, 1). As far as I could tell the bayes net parents are unordered, so I replaced the tuples with frozensets (assuming they need to be immutable), but feel free to reject if that assumption is incorrect.


This change is Reviewable

ahardjasa commented 7 years ago

This is only my second pull request ever so many apologies if I've made some mistakes!

katbusch commented 7 years ago

Looks great! Thanks @ahardjasa!