Skip to content

Commit

Permalink
lint with blake
Browse files Browse the repository at this point in the history
  • Loading branch information
arneboockmeyer committed Jun 24, 2024
1 parent 3be2ffd commit 4a6cd1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion test/topology_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from yaramo.model import Edge, Node, Topology


def test_get_edge_by_nodes():
topology = Topology()

Expand All @@ -23,6 +24,7 @@ def _test_edge(_node_a, _node_b, _expected_edge):
_test_edge(node_b, node_a, edge)
_test_edge(node_a, node_c, None)


def test_json_export_and_import():
topology = Topology()

Expand All @@ -39,4 +41,4 @@ def test_json_export_and_import():
assert len(topology.nodes) == len(topology_copy.nodes)
assert len(topology.edges) == len(topology_copy.edges)
assert len(topology.signals) == len(topology_copy.signals)
assert len(topology.routes) == len(topology_copy.routes)
assert len(topology.routes) == len(topology_copy.routes)
11 changes: 5 additions & 6 deletions yaramo/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,13 @@ def from_json(cls, json_str: str):
if "geo_node" in node and node["geo_node"] is not None:
geo_node = obj["objects"][node["geo_node"]]
geo_node_obj = Wgs84GeoNode(
obj["objects"][geo_node["geo_point"]]["x"],
obj["objects"][geo_node["geo_point"]]["y"],
name=geo_node["name"],
uuid=geo_node["uuid"],
)
obj["objects"][geo_node["geo_point"]]["x"],
obj["objects"][geo_node["geo_point"]]["y"],
name=geo_node["name"],
uuid=geo_node["uuid"],
)
node_obj.geo_node = geo_node_obj


for signal in obj["signals"]:
topology.add_signal(Signal(**signal))
for edge in obj["edges"]:
Expand Down

0 comments on commit 4a6cd1b

Please sign in to comment.