improve table comparison

This commit is contained in:
Sarah Hoffmann
2025-04-04 10:39:04 +02:00
parent dae643c040
commit 5f44aa2873
3 changed files with 32 additions and 20 deletions

View File

@@ -32,3 +32,15 @@ class Grid:
""" Get the coordinates for the given grid node.
"""
return self.grid.get(nodeid)
def parse_point(self, value):
""" Get the coordinates for either a grid node or a full coordinate.
"""
value = value.strip()
if ' ' in value:
return [int(v) for v in value.split(' ', 1)]
return self.grid.get(value)
def parse_line(self, value):
return [self.parse_point(p) for p in value.split(',')]