Skip to content

Commit 0cbfdb8

Browse files
committed
[MINOR] removal of enum OUTPUT_TYPE
Closes #2245
1 parent 9e0f479 commit 0cbfdb8

File tree

192 files changed

+142
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+142
-384
lines changed

.github/workflows/python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ jobs:
127127
export SYSDS_QUIET=1
128128
export LOG4JPROP=$SYSTEMDS_ROOT/src/test/resources/log4j.properties
129129
cd src/main/python
130-
unittest-parallel -t . -s tests
130+
unittest-parallel -t . -s tests -v
131131
# python -m unittest discover -s tests -p 'test_*.py'
132132
echo "Exit Status: " $?
133133
134134
- name: Run all python tests no environment
135135
run: |
136136
export LOG4JPROP=$(pwd)/src/test/resources/log4j.properties
137137
cd src/main/python
138-
unittest-parallel -t . -s tests
138+
unittest-parallel -t . -s tests -v
139139
# python -m unittest discover -s tests -p 'test_*.py'
140140
echo "Exit Status: " $?
141141

src/main/python/generator/resources/template_python_script_imports

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from typing import Dict, Iterable
33

44
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
5-
from systemds.script_building.dag import OutputType
65
from systemds.utils.consts import VALID_INPUT_TYPES
76

87

src/main/python/systemds/context/systemds_context.py

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
from py4j.java_gateway import GatewayParameters, JavaGateway, Py4JNetworkError
4040
from systemds.operator import (Frame, List, Matrix, OperationNode, Scalar,
4141
Source, Combine, MultiReturn)
42-
from systemds.script_building import DMLScript, OutputType
42+
from systemds.script_building import DMLScript
4343
from systemds.utils.consts import VALID_INPUT_TYPES
44-
from systemds.utils.helpers import get_module_dir
44+
from systemds.utils.helpers import get_module_dir, valuetype_from_str
4545

4646

4747
class SystemDSContext(object):
@@ -425,41 +425,6 @@ def full(self, shape: Tuple[int, int], value: Union[float, int]) -> 'Matrix':
425425
named_input_nodes = {'rows': shape[0], 'cols': shape[1]}
426426
return Matrix(self, 'matrix', unnamed_input_nodes, named_input_nodes)
427427

428-
429-
def fft(self, real_input: 'Matrix') -> 'MultiReturn':
430-
"""
431-
Performs the Fast Fourier Transform (FFT) on the matrix.
432-
:param real_input: The real part of the input matrix.
433-
:return: A MultiReturn object representing the real and imaginary parts of the FFT output.
434-
"""
435-
436-
real_output = OperationNode(self, '', output_type=OutputType.MATRIX, is_python_local_data=False)
437-
imag_output = OperationNode(self, '', output_type=OutputType.MATRIX, is_python_local_data=False)
438-
439-
fft_node = MultiReturn(self, 'fft', [real_output, imag_output], [real_input])
440-
441-
return fft_node
442-
443-
444-
def ifft(self, real_input: 'Matrix', imag_input: 'Matrix' = None) -> 'MultiReturn':
445-
"""
446-
Performs the Inverse Fast Fourier Transform (IFFT) on a complex matrix.
447-
448-
:param real_input: The real part of the input matrix.
449-
:param imag_input: The imaginary part of the input matrix (optional).
450-
:return: A MultiReturn object representing the real and imaginary parts of the IFFT output.
451-
"""
452-
453-
real_output = OperationNode(self, '', output_type=OutputType.MATRIX, is_python_local_data=False)
454-
imag_output = OperationNode(self, '', output_type=OutputType.MATRIX, is_python_local_data=False)
455-
456-
if imag_input is not None:
457-
ifft_node = MultiReturn(self, 'ifft', [real_output, imag_output], [real_input, imag_input])
458-
else:
459-
ifft_node = MultiReturn(self, 'ifft', [real_output, imag_output], [real_input])
460-
461-
return ifft_node
462-
463428
def seq(self, start: Union[float, int], stop: Union[float, int] = None,
464429
step: Union[float, int] = 1) -> 'Matrix':
465430
"""Create a single column vector with values from `start` to `stop` and an increment of `step`.
@@ -558,10 +523,10 @@ def read(self, path: os.PathLike, **kwargs: Dict[str, VALID_INPUT_TYPES]) -> Ope
558523
return Frame(self, "read", [f'"{path}"'], named_input_nodes=kwargs)
559524
elif data_type == "scalar":
560525
kwargs["data_type"] = f'"{data_type}"'
561-
output_type = OutputType.from_str(kwargs.get("value_type", None))
562-
if output_type:
563-
kwargs["value_type"] = f'"{output_type.name}"'
564-
return Scalar(self, "read", [f'"{path}"'], named_input_nodes=kwargs, output_type=output_type)
526+
value_type = valuetype_from_str(kwargs.get("value_type", None))
527+
if value_type:
528+
kwargs["value_type"] = f'"{value_type}"'
529+
return Scalar(self, "read", [f'"{path}"'], named_input_nodes=kwargs)
565530
else:
566531
raise ValueError(
567532
"Invalid arguments for reading scalar, value_type must be specified")
@@ -584,7 +549,7 @@ def scalar(self, v: Dict[str, VALID_INPUT_TYPES]) -> Scalar:
584549

585550
# output type assign simply assigns the given variable to the value
586551
# therefore the output type is assign.
587-
return Scalar(self, v, assign=True, output_type=OutputType.from_str(v))
552+
return Scalar(self, v, assign=True)
588553

589554
def from_numpy(self, mat: np.array,
590555
*args: Sequence[VALID_INPUT_TYPES],

src/main/python/systemds/operator/algorithm/builtin/WoE.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Dict, Iterable
2626

2727
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28-
from systemds.script_building.dag import OutputType
2928
from systemds.utils.consts import VALID_INPUT_TYPES
3029

3130

src/main/python/systemds/operator/algorithm/builtin/WoEApply.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Dict, Iterable
2626

2727
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28-
from systemds.script_building.dag import OutputType
2928
from systemds.utils.consts import VALID_INPUT_TYPES
3029

3130

src/main/python/systemds/operator/algorithm/builtin/abstain.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Dict, Iterable
2626

2727
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28-
from systemds.script_building.dag import OutputType
2928
from systemds.utils.consts import VALID_INPUT_TYPES
3029

3130

src/main/python/systemds/operator/algorithm/builtin/als.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Dict, Iterable
2626

2727
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28-
from systemds.script_building.dag import OutputType
2928
from systemds.utils.consts import VALID_INPUT_TYPES
3029

3130

src/main/python/systemds/operator/algorithm/builtin/alsCG.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Dict, Iterable
2626

2727
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28-
from systemds.script_building.dag import OutputType
2928
from systemds.utils.consts import VALID_INPUT_TYPES
3029

3130

src/main/python/systemds/operator/algorithm/builtin/alsDS.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Dict, Iterable
2626

2727
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28-
from systemds.script_building.dag import OutputType
2928
from systemds.utils.consts import VALID_INPUT_TYPES
3029

3130

src/main/python/systemds/operator/algorithm/builtin/alsPredict.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Dict, Iterable
2626

2727
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28-
from systemds.script_building.dag import OutputType
2928
from systemds.utils.consts import VALID_INPUT_TYPES
3029

3130

0 commit comments

Comments
 (0)