RA2CE helps to quantify resilience of critical infrastructure networks, prioritize interventions and adaptation measures and select the most appropriate action perspective to increase resilience considering future conditions.
[x] I HAVE NOT added sensitive or compromised (test) data to the repository.
[x] I HAVE NOT added vulnerabilities to the repository.
[ ] I HAVE discussed my solution with (other) members of the RA2CE team.
What has been done?
In several cases some edges have avgspeed == None and time == 0. To give valid results:
the mean avgspeed of all edges of the same road type with a valid avgspeed (>0) is taken;
if none of the edges of the same road type have a valid avgspeed, the mean avgspeed of all edges in the network with valid avgspeed (>0) is taken;
if none of the edges in the network has a valid avgspeed, a default value (hardcoded 50) is returned.
this could be moved to the config and defined per road type later on.
Checklist
[x] Code is formatted using our custom black and isort definitions.
[x] Tests are either added or updated.
[x] Branch is up to date with master.
[ ] Updated documentation if needed.
Additional Notes (optional)
Calculate current time/distance value before removing edges from the graph to ensure all edges have the needed attributes to calculate the dijkstra_path with the right weighing.
Removed extend_gdf and add current values (time/distance) after the loop from the list.
Issue addressed
Solves #433
Code of conduct
What has been done?
In several cases some edges have
avgspeed == None
andtime == 0
. To give valid results:Checklist
black
andisort
definitions.master
.Additional Notes (optional)
extend_gdf
and add current values (time/distance) after the loop from the list.