Changeset 680 for mds-and-trees


Ignore:
Timestamp:
08/27/17 20:05:45 (3 years ago)
Author:
konrad
Message:

Fixed the "ValueError?: max() arg is an empty sequence" error occurring for -t GENERATIONAL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mds-and-trees/tree-genealogy.py

    r679 r680  
    465465                elif self.TIME == "GENERATIONAL":
    466466                    # one more than its parent (what if more than one parent?)
    467                     ypos = max([self.positions[par]['y'] for par, v in self.tree.parents[child].items()])+1
     467                    ypos = max([self.positions[par]['y'] for par, v in self.tree.parents[child].items()])+1 \
     468                        if self.tree.parents[child] else 0
    468469                elif self.TIME == "REAL":
    469470                    ypos = self.tree.time[child]
Note: See TracChangeset for help on using the changeset viewer.