[core][io] store nodes position in graph file

* increment file minor version (no incompatibility)
* nodeFactory: reload file position if available
This commit is contained in:
Yann Lanthony 2018-07-26 15:08:20 +02:00
parent dfb0934ef4
commit e2155ba962
2 changed files with 10 additions and 3 deletions

View file

@ -162,7 +162,7 @@ class Graph(BaseObject):
class IO(object):
""" Centralize Graph file keys and IO version. """
__version__ = "1.0"
__version__ = "1.1"
class Keys(object):
""" File Keys. """
@ -179,6 +179,7 @@ class Graph(BaseObject):
Header = "header"
NodesVersions = "nodesVersions"
PrecomputedOutputs = "precomputedOutputs"
NodesPositions = "nodesPositions"
@staticmethod
def getFeaturesForVersion(fileVersion):
@ -199,6 +200,8 @@ class Graph(BaseObject):
Graph.IO.Features.NodesVersions,
Graph.IO.Features.PrecomputedOutputs,
]
if fileVersion >= Version("1.1"):
features += [Graph.IO.Features.NodesPositions]
return features
def __init__(self, name, parent=None):