Skip to content

Commit e7a5e11

Browse files
authored
Merge pull request #61 from simulate-digital-rail/add-default-railway-option-type
Add default railway option type and fix test
2 parents 102d7c6 + a4cc50c commit e7a5e11

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

orm_importer/importer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ def _should_add_edge(self, node_a: model.Node, node_b: model.Node, path: list[in
145145
present_paths = self.paths[(node_a, node_b)] + self.paths[(node_b, node_a)]
146146
return path not in present_paths and reversed_path not in present_paths
147147

148-
def run(self, polygon, railway_option_types):
148+
def run(self, polygon, railway_option_types: list[str] = None):
149+
if railway_option_types is None:
150+
railway_option_types = ["rail"]
149151
track_objects = self._get_track_objects(polygon, railway_option_types)
150152
self.graph = self._build_graph(track_objects)
151153

tests/test_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ def test_query_griebnitzsee(mock_converter):
2020

2121
assert len(res.nodes) == 10
2222
assert len(res.edges) == 9
23-
assert len(res.signals) == 9
23+
assert len(res.signals) == 17

0 commit comments

Comments
 (0)