Skip to content

Commit

Permalink
Merge pull request #61 from simulate-digital-rail/add-default-railway…
Browse files Browse the repository at this point in the history
…-option-type

Add default railway option type and fix test
  • Loading branch information
lpirl authored Jun 21, 2024
2 parents 102d7c6 + a4cc50c commit e7a5e11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit e7a5e11

Please sign in to comment.