Baunsgaard commented on a change in pull request #874: Add SystemDSContext for systemds operations URL: https://github.com/apache/systemml/pull/874#discussion_r403498141
########## File path: src/main/python/systemds/matrix/operation_node.py ########## @@ -19,86 +19,92 @@ # #------------------------------------------------------------- +from typing import Union, Optional, Iterable, Dict, Sequence, Tuple, TYPE_CHECKING + import numpy as np from py4j.java_gateway import JVMView, JavaObject -from typing import Union, Optional, Iterable, Dict, Sequence, Tuple -from systemds.utils.helpers import get_gateway, create_params_string +from systemds.utils.consts import VALID_INPUT_TYPES, BINARY_OPERATIONS, VALID_ARITHMETIC_TYPES +from systemds.utils.helpers import create_params_string from systemds.utils.converters import matrix_block_to_numpy from systemds.script_building.script import DMLScript -from systemds.script_building.dag import OutputType, DAGNode, VALID_INPUT_TYPES +from systemds.script_building.dag import OutputType, DAGNode -BINARY_OPERATIONS = ['+', '-', '/', '//', '*', '<', '<=', '>', '>=', '==', '!='] -# TODO add numpy array -VALID_ARITHMETIC_TYPES = Union[DAGNode, int, float] +if TYPE_CHECKING: + # so we don't get cyclic dependencies during runtime Review comment: If you change the other one i commented on change all of them. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services