Coverage for skema/gromet/execution_engine/types/array.py: 91%

11 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-04-30 17:15 +0000

1import numpy 

2from typing import Any 

3 

4from skema.gromet.execution_engine.types.defined_types import Field 

5 

6 

7class new_Array(object): 

8 source_language_name = {"Python": "new_Array"} 

9 inputs = [Field("elements", "Any", True)] 

10 outputs = [Field("array_output", "Array")] 

11 shorthand = "new_Array" 

12 documentation = "" 

13 

14 def exec(*elements: Any) -> numpy.ndarray: 

15 return numpy.array(list(elements))