Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide by zero error for small suburbs #14

Open
Stu5000 opened this issue Aug 30, 2021 · 0 comments
Open

Divide by zero error for small suburbs #14

Stu5000 opened this issue Aug 30, 2021 · 0 comments

Comments

@Stu5000
Copy link

Stu5000 commented Aug 30, 2021

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,)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant