Sam Jaffe 1 kuukausi sitten
vanhempi
commit
9015450610
2 muutettua tiedostoa jossa 8 lisäystä ja 2 poistoa
  1. 3 1
      src/cipy/__init__.py
  2. 5 1
      src/cipy/workflow.py

+ 3 - 1
src/cipy/__init__.py

@@ -9,13 +9,15 @@ import pydantic
 from cipy.action import Composite, NodeScript, Script
 from cipy.common import Context, Factory, Inputs, Outputs, Ref, Status
 from cipy.shell import Shell
-from cipy.workflow import Job, Workflow
+from cipy.workflow import Job, Matrix, MatrixParams, Workflow
 
 __all__ = [
     "Composite",
     "Context",
     "Inputs",
     "Job",
+    "Matrix",
+    "MatrixParams",
     "NodeScript",
     "Outputs",
     "Script",

+ 5 - 1
src/cipy/workflow.py

@@ -70,11 +70,15 @@ class Workflow(Action):
         return status
 
 
+type MatrixParams = dict[str, list[Scalar | Ref]] | list[dict[str, Scalar | Ref]]
+
+
 class Matrix(Action):
     """
     Actions that represent running a single Workflow/Action across multiple configurations
     """
-    matrix: dict[str, list[Scalar | Ref]] | list[dict[str, Scalar | Ref]]
+    name: str = ""
+    matrix: MatrixParams
     uses: Action
     fail_fast: bool = True