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

Add default railway option type and fix test #61

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion orm_importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ def _should_add_edge(self, node_a: model.Node, node_b: model.Node, path: list[in
present_paths = self.paths[(node_a, node_b)] + self.paths[(node_b, node_a)]
return path not in present_paths and reversed_path not in present_paths

def run(self, polygon, railway_option_types):
def run(self, polygon, railway_option_types: list[str] = None):
if railway_option_types is None:
railway_option_types = ["rail"]
track_objects = self._get_track_objects(polygon, railway_option_types)
self.graph = self._build_graph(track_objects)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def test_query_griebnitzsee(mock_converter):

assert len(res.nodes) == 10
assert len(res.edges) == 9
assert len(res.signals) == 9
assert len(res.signals) == 17
Loading