mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-16 17:51:58 +02:00
[core] Add 'strictCompatibility' mode for loadGraph function
Provide a way to control how to handle node compatibility issues when loading a Graph with the `strictCompatibility` parameter. Introduce a new error type, GraphCompatibilityError, to be raised when loading a Graph with compatibility issues with strictCompatibility enabled.
This commit is contained in:
parent
c3bb55a414
commit
c09a0d2327
2 changed files with 33 additions and 2 deletions
|
@ -12,6 +12,21 @@ class GraphException(MeshroomException):
|
|||
pass
|
||||
|
||||
|
||||
class GraphCompatibilityError(GraphException):
|
||||
"""
|
||||
Raised when node compatibility issues occur when loading a graph.
|
||||
|
||||
Args:
|
||||
filepath: The path to the file that caused the error.
|
||||
issues: A dictionnary of node names and their respective compatibility issues.
|
||||
"""
|
||||
def __init__(self, filepath, issues: dict[str, str]) -> None:
|
||||
self.filepath = filepath
|
||||
self.issues = issues
|
||||
msg = f"Compatibility issues found when loading {self.filepath}: {self.issues}"
|
||||
super().__init__(msg)
|
||||
|
||||
|
||||
class UnknownNodeTypeError(GraphException):
|
||||
"""
|
||||
Raised when asked to create a unknown node type.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue