optiburb
optiburb copied to clipboard
Divide by zero error for small suburbs
For small suburbs I kept getting divide by zero errors from the dijkstra progress logging. The _prev_time and _cur_time must have been the same.
Traceback (most recent call last): File "optiburb.py", line 767, in
burbing.determine_combinations() File "optiburb.py", line 335, in determine_combinations odd_pair_paths = self.get_shortest_path_pairs(self.g, odd_node_pairs) File "optiburb.py", line 188, in get_shortest_path_pairs log.info('dijkstra progress %s%%, [%d/%d] %d/second', _cur_pct, n, _size, (_prev_n - n) / (_prev_time - _cur_time)) ZeroDivisionError: float division by zero
To get past this I changed the log.info call on line 188 to:
log.info('dijkstra progress %s%%, [%d/%d]', _cur_pct, n, _size,)