Florian il y a 6 ans
Parent
commit
ba1ca8b264
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      plan_gen.py

+ 2 - 2
plan_gen.py

@@ -18,7 +18,7 @@ def read_nodes(input_network):
 
 def rand_time(low, high):
     ''' returns a random time between low and high bounds (in seconds) '''
-    delta = np.random.randint(high - low);
+    delta = np.random.randint(high - low)
     return time.strftime('%H:%M:%S', time.gmtime(low + delta))
 
 def rand_person(nodes):
@@ -34,7 +34,7 @@ def rand_person(nodes):
     home_departure = rand_time(MIN_DEPARTURE_TIME, MAX_DEPARTURE_TIME)
     return {'home': home_xy, 'work': work_xy, 'home_departure': home_departure}
 
-def create_child(parent_node, child_name, child_attrs={}):
+def create_child(parent_node, child_name, child_attrs=None):
     ''' creates an xml child element and set its attributes '''
     child = etree.SubElement(parent_node, child_name)
     for attr, value in child_attrs.items():