From ffbccdc150808b68b30c3ecaa03c49fd862f6595 Mon Sep 17 00:00:00 2001 From: Todd Roper Date: Mon, 31 Jul 2023 10:21:43 -0700 Subject: [PATCH] Fixed no model id issue. --- dev/tools/copy_project.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dev/tools/copy_project.py b/dev/tools/copy_project.py index bd0e95a0..762592e3 100644 --- a/dev/tools/copy_project.py +++ b/dev/tools/copy_project.py @@ -236,9 +236,10 @@ def _process_workflow_nodes(self, nodes: list, workflow_id: str): node["state"]["datasetId"] ] elif op == "ModelOperation": - node_obj["state"]["modelId"] = self.id_mapper["models"][ - node["state"]["modelId"] - ] + if "state" in node and "modelId" in node["state"]: + node_obj["state"]["modelId"] = self.id_mapper["models"][ + node["state"]["modelId"] + ] else: print(f"{op} is not currently supported.") updated_nodes.append(node_obj) @@ -261,7 +262,11 @@ def _process_workflow_models(self, models: list): Method processes the workflow model objects to extract configurations. """ for model in models: - new_model_id = self.id_mapper["models"][model["state"]["modelId"]] + model_state = model["state"] if "state" in model else None + if "modelId" in model_state: + new_model_id = self.id_mapper["models"][model_state["modelId"]] + else: + new_model_id = None # Currently no projects I have looked at have model inputs. - Todd R. July 27, 2023 if len(model["inputs"]):