From adb76383a22e5f0fac848b780608e7e7dad662ff Mon Sep 17 00:00:00 2001 From: Katherine Mantel Date: Wed, 25 Oct 2023 00:45:25 +0000 Subject: [PATCH] mg gsc custom gsc rename func arg --- src/graph_scheduler/condition.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/graph_scheduler/condition.py b/src/graph_scheduler/condition.py index 8f68cc14..a8d44676 100644 --- a/src/graph_scheduler/condition.py +++ b/src/graph_scheduler/condition.py @@ -2777,26 +2777,26 @@ def _actions_names_max_length(cls): class CustomGraphStructureCondition(GraphStructureCondition): def __init__( - self, custom_process: typing.Callable[[dict], dict], *nodes, **kwargs + self, process_graph_function: typing.Callable[[dict], dict], *nodes, **kwargs ): - self.custom_process = custom_process + self.process_graph_function = process_graph_function super().__init__(*nodes, **kwargs) def __str__(self): - return self._make_str({"custom_process": self.custom_process}) + return self._make_str({"process_graph_function": self.process_graph_function}) def _process(self, graph: dict) -> dict: graph = super()._process(graph) - sig = inspect.signature(self.custom_process) + sig = inspect.signature(self.process_graph_function) if 'self' in sig.parameters: if next(iter(sig.parameters)) != 'self': raise ConditionError( - "If using 'self' in custom_process, it must be the first argument" + "If using 'self' in process_graph_function, it must be the first argument" ) - return self.custom_process(self, graph) + return self.process_graph_function(self, graph) else: - return self.custom_process(graph) + return self.process_graph_function(graph) class GSCReposition(GraphStructureCondition):