Skip to content

Commit 95abfdc

Browse files
authored
Merge pull request #139 from Exabyte-io/feature/SOF-7859-1
update: add clean dict
2 parents da39a6b + 1ff9e92 commit 95abfdc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/py/mat3ra/wode/workflows/workflow.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,12 @@ def remove_relaxation(self) -> None:
9090
existing = self._find_relaxation_subworkflow()
9191
if existing is not None:
9292
self.remove_subworkflow_by_id(existing.id)
93+
94+
def to_dict_without_special_keys(self, special_keys=["context"]) -> Dict[str, Any]:
95+
workflow_dict = self.to_dict()
96+
for swf in workflow_dict.get("subworkflows", []):
97+
for unit in swf.get("units", []):
98+
for key in special_keys:
99+
if key in unit:
100+
unit[key] = {}
101+
return workflow_dict

0 commit comments

Comments
 (0)