mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-04 20:01:58 +02:00
[core] Introducing new graphIO module
Move Graph.IO internal class to its own module, and rename it to `GraphIO`. This avoid nested classes within the core Graph class, and starts decoupling the management of graph's IO from the logic of the graph itself.
This commit is contained in:
parent
3064cb9b35
commit
a665200c38
4 changed files with 76 additions and 63 deletions
|
@ -4,6 +4,7 @@
|
|||
from meshroom.core.graph import Graph
|
||||
from meshroom.core import pipelineTemplates, Version
|
||||
from meshroom.core.node import CompatibilityIssue, CompatibilityNode
|
||||
from meshroom.core.graphIO import GraphIO
|
||||
|
||||
import json
|
||||
import meshroom
|
||||
|
@ -24,13 +25,13 @@ def test_templateVersions():
|
|||
with open(path) as jsonFile:
|
||||
fileData = json.load(jsonFile)
|
||||
|
||||
graphData = fileData.get(Graph.IO.Keys.Graph, fileData)
|
||||
graphData = fileData.get(GraphIO.Keys.Graph, fileData)
|
||||
|
||||
assert isinstance(graphData, dict)
|
||||
|
||||
header = fileData.get(Graph.IO.Keys.Header, {})
|
||||
header = fileData.get(GraphIO.Keys.Header, {})
|
||||
assert header.get("template", False)
|
||||
nodesVersions = header.get(Graph.IO.Keys.NodesVersions, {})
|
||||
nodesVersions = header.get(GraphIO.Keys.NodesVersions, {})
|
||||
|
||||
for _, nodeData in graphData.items():
|
||||
nodeType = nodeData["nodeType"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue