[bin] Fix all the scripts that had errors

- `meshroom_submit`: the submission to the render farm is now effective
(the script did not work at all).
- `meshroom_status`: the `--toNode` option did not work and caused errors.
- `meshroom_statistics`: some adjustments needed to be made for the script
to run with Python3 instead of Python2, an issue in the core/stats.py file
led the `statistics` file to never being read correctly, and the calls
to the Matplotlib API were outdated.
This commit is contained in:
Candice Bentéjac 2023-04-24 16:43:01 +02:00
parent c63dbc2588
commit be4c02f515
3 changed files with 6 additions and 7 deletions

View file

@ -3,7 +3,8 @@ import argparse
import os
import sys
from pprint import pprint
from collections import Iterable, defaultdict
from collections import defaultdict
from collections.abc import Iterable
from meshroom.core import graph as pg
@ -15,11 +16,11 @@ def addPlots(curves, title, fileObj):
import matplotlib.pyplot as plt, mpld3
fig = plt.figure()
ax = fig.add_subplot(111, axisbg='#EEEEEE')
ax = fig.add_subplot(111, facecolor='#EEEEEE')
ax.grid(color='white', linestyle='solid')
for curveName, curve in curves:
if not isinstance(curve[0], pg.basestring):
if not isinstance(curve[0], str):
ax.plot(curve, label=curveName)
ax.legend()
# plt.ylim(0, 100)

View file

@ -42,11 +42,10 @@ if args.node:
else:
startNodes = None
if args.toNode:
startNodes = [graph.nodes(args.toNode)]
startNodes = [graph.findNode(args.toNode)]
nodes, edges = graph.dfsOnFinish(startNodes=startNodes)
for node in nodes:
for chunk in node.chunks:
print('{}: {}'.format(chunk.name, chunk.status.status.name))
if args.verbose:
pprint([n.status.toDict() for n in nodes])

View file

@ -11,7 +11,6 @@ parser.add_argument('meshroomFile', metavar='MESHROOMFILE.mg', type=str,
help='Filepath to a graph file.')
parser.add_argument('--toNode', metavar='NODE_NAME', type=str,
help='Process the node with its dependencies.')
parser.add_argument('--submitter',
type=str,
default='SimpleFarm',
@ -23,4 +22,4 @@ parser.add_argument("--submitLabel",
args = parser.parse_args()
meshroom.core.graph.submit(args.save, args.submitter, toNode=toNodes, submitLabel=args.submitLabel)
meshroom.core.graph.submit(args.meshroomFile, args.submitter, toNode=args.toNode, submitLabel=args.submitLabel)