From be4c02f515171f13d950d997d51e096eb91415a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Mon, 24 Apr 2023 16:43:01 +0200 Subject: [PATCH] [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. --- bin/meshroom_statistics | 7 ++++--- bin/meshroom_status | 3 +-- bin/meshroom_submit | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/meshroom_statistics b/bin/meshroom_statistics index 57636ed3..4c9592ee 100755 --- a/bin/meshroom_statistics +++ b/bin/meshroom_statistics @@ -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) diff --git a/bin/meshroom_status b/bin/meshroom_status index 95abdcdd..68968a13 100755 --- a/bin/meshroom_status +++ b/bin/meshroom_status @@ -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]) - diff --git a/bin/meshroom_submit b/bin/meshroom_submit index 35a3edb7..1aee71e1 100755 --- a/bin/meshroom_submit +++ b/bin/meshroom_submit @@ -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)