Sam Jaffe 2 mēneši atpakaļ
vecāks
revīzija
9015450610
2 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  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.action import Composite, NodeScript, Script
 from cipy.common import Context, Factory, Inputs, Outputs, Ref, Status
 from cipy.common import Context, Factory, Inputs, Outputs, Ref, Status
 from cipy.shell import Shell
 from cipy.shell import Shell
-from cipy.workflow import Job, Workflow
+from cipy.workflow import Job, Matrix, MatrixParams, Workflow
 
 
 __all__ = [
 __all__ = [
     "Composite",
     "Composite",
     "Context",
     "Context",
     "Inputs",
     "Inputs",
     "Job",
     "Job",
+    "Matrix",
+    "MatrixParams",
     "NodeScript",
     "NodeScript",
     "Outputs",
     "Outputs",
     "Script",
     "Script",

+ 5 - 1
src/cipy/workflow.py

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