Skip to content

Commit

Permalink
Address weird capital P (to tackle #24)
Browse files Browse the repository at this point in the history
  • Loading branch information
LimHyungTae committed Dec 12, 2024
1 parent 8de35eb commit fbe2add
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/src/spark_dsg/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
def z_offset(node) -> np.ndarray:
"""Take a node and returns an offset in the z direction according to node type."""
offset = node.attributes.position.copy()
offset[2] += NODE_TYPE_OFFSET[node.id.category]
if node.id.category == "P":
offset[2] += NODE_TYPE_OFFSET["p"]
else :
offset[2] += NODE_TYPE_OFFSET[node.id.category]

return offset


Expand All @@ -65,7 +69,10 @@ def _draw_layer_nodes(
for node in layer.nodes:
pos.append(np.squeeze(z_offset(node)))
if color_func is None:
colors.append(NODE_TYPE_TO_COLOR[node.id.category])
if node.id.category == "P":
colors.append(NODE_TYPE_OFFSET["p"])
else :
colors.append(NODE_TYPE_OFFSET[node.id.category])
else:
colors.append(color_func(node))

Expand Down

0 comments on commit fbe2add

Please sign in to comment.