bc0a284284e49f72fe358f6064a30a54d0a112f4,descarteslabs/workflows/types/numpy/numpy_overrides.py,ufunc,__call__,#ufunc#,57

Before Change


                if isinstance(arg, np.ndarray):
                    promoted.append(Array.from_numpy(arg))
                else:
                    promoted.append(Array._promote(arg))
            except ProxyTypeError:
                try:
                    promoted.append(Int._promote(arg))

After Change


        promoted = []
        for i, arg in enumerate(args):
            try:
                if isinstance(arg, Array):
                    promoted.append(arg)
                elif isinstance(arg, np.ndarray):
                    promoted.append(Array.from_numpy(arg))
                else:
                    promoted.append(_promote(arg, (Bool, Int, Float), i, self.__name__))
                    // TODO(gabe) not great to be relying on internal `_promote` here
            except (ProxyTypeError, TypeError):
                raise ProxyTypeError(
                    "Argument {} to function {} must be a Workflows Array, number, bool, or "
                    "a type promotable to one of those, not {}".format(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: descarteslabs/descarteslabs-python
Commit Name: bc0a284284e49f72fe358f6064a30a54d0a112f4
Time: 2020-03-10
Author: gabe@descarteslabs.com
File Name: descarteslabs/workflows/types/numpy/numpy_overrides.py
Class Name: ufunc
Method Name: __call__


Project Name: descarteslabs/descarteslabs-python
Commit Name: b17e18b4224450aeb24e61d5545016dfe3f1b81a
Time: 2021-01-05
Author: gabe@descarteslabs.com
File Name: descarteslabs/workflows/execution/arguments.py
Class Name:
Method Name: promote_arguments


Project Name: descarteslabs/descarteslabs-python
Commit Name: 2c76358bcdbd01b199c04893370c3b06e867cca9
Time: 2020-03-30
Author: 51922948+sdelany2@users.noreply.github.com
File Name: descarteslabs/workflows/types/array/array_.py
Class Name: Array
Method Name: _promote