improve graph making while agr reading

This commit is contained in:
Dominik Demuth 2023-12-25 13:49:07 +01:00
parent 17458f455b
commit 7290b62003

View File

@ -216,10 +216,9 @@ class GraceEditor:
def _make_graph(self, line: str):
m = self._RE_GRAPH_START.match(line)
g_idx = int(m.group(1))
if g_idx < len(self.graphs):
while g_idx < len(self.graphs):
# this assumes that graphs are ordered in agr file even if missing, e.g. we read gß, g1, g3, ...
while g_idx != len(self.graphs):
self.graphs.append(GraceGraph(len(self.graphs)))
self.graphs.append(GraceGraph(len(self.graphs)))
self.graphs.append(GraceGraph(g_idx))