A pythonic implementation of Mendelian inheritance