Changeset 566
- Timestamp:
- 08/06/16 02:16:56 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mds-and-trees/tree-genealogy.py
r564 r566 81 81 if not creature["FromIDs"][0] in nodes: 82 82 firstnode = creature["FromIDs"][0] 83 if "Time" in creature: 84 time[creature["ID"]] = creature["Time"] 83 85 84 86 for k, v in sorted(nodes.items()): … … 150 152 #print(node + "->" + c) 151 153 dissimilarity = 0.5 #random.gauss(0,0.3) 152 if TIME == " REAL":154 if TIME == "BIRTHS": 153 155 id = "" 154 156 if c[0] == "c": … … 159 161 elif TIME == "GENERATIONAL": 160 162 positions[c] = [xmin_crowd(positions[node][0]-dissimilarity, positions[node][0]+dissimilarity, positions[node][1]+1), positions[node][1]+1] 163 elif TIME == "REAL": 164 positions[c] = [xmin_crowd(positions[node][0]-dissimilarity, positions[node][0]+dissimilarity, time[c]), time[c]] 161 165 162 166 for c in inv_nodes[node]: … … 166 170 def prepos_children(): 167 171 global max_height, max_width, min_width 172 173 if not bool(time): 174 print("REAL time requested, but no real time data provided. Assuming BIRTHS time instead.") 175 TIME = "BIRTHS" 168 176 169 177 positions[firstnode] = [0, 0] … … 258 266 positions = {} 259 267 depth = {} 268 time = {} 260 269 261 270 def main(): … … 278 287 279 288 #TODO: better names for those parameters 280 parser.add_argument('--time', default=' REAL', dest='time', help='values on vertical axis (REAL/GENERATIONAL)')289 parser.add_argument('--time', default='BIRTHS', dest='time', help='values on vertical axis (REAL/GENERATIONAL)') 281 290 parser.add_argument('--balance', default='MIN',dest='balance', help='method of placing node in the tree (RANDOM/MIN/DENSITY)') 282 291
Note: See TracChangeset
for help on using the changeset viewer.