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

Crosscade #294

Merged
merged 44 commits into from
Mar 28, 2024
Merged

Crosscade #294

merged 44 commits into from
Mar 28, 2024

Conversation

sahand-asgarpour
Copy link
Contributor

No description provided.

…ach other is resolved. has to test. Road cleaned, still should be used
…us attempt to exclude bridges was not sufficient
…ave these attributes. needed for the osmnx function used
…to include edge attributes in the graph, e.g., bridge
…ibutes already exist. Otherwise bridge attributes were overwritten and became nan which was wrong. It had to do with the used osmnx function
…move conditions updated to exclude bridges with the right criteria
Copy link
Collaborator

@Carsopre Carsopre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several changes need to be addressed to merge it into master.

ra2ce/graph/network_wrappers/vector_network_wrapper.py Outdated Show resolved Hide resolved
ra2ce/graph/network_wrappers/vector_network_wrapper.py Outdated Show resolved Hide resolved
ra2ce/graph/network_wrappers/vector_network_wrapper.py Outdated Show resolved Hide resolved
ra2ce/graph/networks_utils.py Outdated Show resolved Hide resolved
ra2ce/graph/origins_destinations.py Outdated Show resolved Hide resolved
ra2ce/graph/origins_destinations.py Outdated Show resolved Hide resolved
inverse_nodes_dict,
graph,
)
assert len(new_lines) == 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not going to happen at this point (you entered the if condition with len(new_lines) == 1.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line.

graph,
)
assert len(new_lines) == 2
assert len([match_od_point]) == 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be doing this outside this if, rather than after spending time with find_closest_node.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for further action as this was the previous behavior

inverse_vertices_dict,
)

except (KeyError, AssertionError):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of having try-except, the second one (AssertionError) can be avoided with relative small code modifications, but how is the first one ( KeyError) triggered?

@Carsopre Carsopre added the help wanted Extra attention is needed label Mar 28, 2024
@Carsopre Carsopre merged commit fe8d862 into master Mar 28, 2024
5 checks passed
@Carsopre Carsopre deleted the crosscade branch March 28, 2024 18:42
Carsopre added a commit that referenced this pull request Apr 12, 2024
* chore: origins_destinations.py is adjusted to Point Z structure that is used for POints

* chore: update_edges_with_new_node updated and node adding on top of each other is resolved. has to test. Road cleaned, still should be used

* chore: update edege of graph is modified to correct the direction of the u-new_v etc.

* fix/feat: allowing mapping ods to all nodes at one location and required changes

* minor

* feat trace has_path origins 1

* chore: node_checked_has_path added _find_optimal_toute

* feat: _delete_duplicate_nodes added to remove graph node duplicates and connect the graph as far as possible

* feat: minor

* feat: None check added _find_optimal_route

* fix: hazard shp get_hazard files is corrected

* feat; include more road types

* feat; include bridge attribute in the graph. Also exclude bridge==yes when want to define edges to remove

* feat; exclude bridge==yes when want to define edges to remove. previous attempt to exclude bridges was not sufficient

* feat; exclude bridge==yes when want to define edges to remove for the multi-od analysis

* feat: _include_attributes updated to add x y for nodes if they dont have these attributes. needed for the osmnx function used

* feat: in VectorNetworkWrapper.get_network() a functionality is added to include edge attributes in the graph, e.g., bridge

* fix: fid removed

* fix: _include_attributes updated to exclude being activated when attributes already exist. Otherwise bridge attributes were overwritten and became nan which was wrong. It had to do with the used osmnx function

* fix: fid is excluded from being considered when reading the road input file. It gave error when making gpkg

* fix: in od analysis multi_link_origin_closest_destination edges_to_remove conditions updated to exclude bridges with the right criteria

* feat: Simplify functionality added when introducing shapefile as an input road network

* docs: isolated locations

* chore: gpd import

* feat: bridges control and exclusion from the analysis

* chore: Indentation reformatted.

* chore: corrections because of the created enums.

* chore: Obsolete imports are resolved

* chore: Obsolete imports are resolved and standardised the osmnx function which had to modify

* chore: Obsolete imports are resolved.

* chore: edge_attributes_to_include=None is resolved

* chore: check if attributes to include exist in gdf

* chore: check if attributes to include exist in gdf

* chore: Updated call and fixed test

* chore: small corrections and fixed failing tests

* chore: Removed irrelevant file

* chore: Fixed return of closest_node to be the same return type as earlier

* chore: Fixed incorrect reference to analysis threshold

* feat: bridge controlling is updated

* chore: _is_not_none(value) is added

---------

Co-authored-by: Carles S. Soriano Perez <carles.sorianoperez@deltares.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude bridges or tunnels from the criticality analyses pof ra2ce (e.g., redundancy and OD analyses
2 participants