Beispiel #1
0
def dispatch(angle: typing.Any, v: typing.Any) -> typing.Any:
    function, *returns = _from_signature(__name__, dispatch_map,
                                         (_aztype(v), ))
    with numpy.errstate(all="ignore"):
        return v._wrap_result(_flavor_of(v),
                              function(v.lib, angle, *v.azimuthal.elements),
                              returns, 1)
Beispiel #2
0
def dispatch(tolerance: typing.Any, v1: typing.Any,
             v2: typing.Any) -> typing.Any:
    function, *returns = _from_signature(
        __name__,
        dispatch_map,
        (
            _aztype(v1),
            _ltype(v1),
            _aztype(v2),
            _ltype(v2),
        ),
    )
    with numpy.errstate(all="ignore"):
        return _handler_of(v1, v2)._wrap_result(
            _flavor_of(v1, v2),
            function(
                _lib_of(v1, v2),
                tolerance,
                *v1.azimuthal.elements,
                *v1.longitudinal.elements,
                *v2.azimuthal.elements,
                *v2.longitudinal.elements,
            ),
            returns,
            2,
        )
Beispiel #3
0
def dispatch(angle: typing.Any, v1: typing.Any, v2: typing.Any) -> typing.Any:
    function, *returns = _from_signature(
        __name__,
        dispatch_map,
        (
            _aztype(v1),  # v1 is the axis about which we're rotating
            _ltype(v1),
            _aztype(v2),  # v2 is the primary vector, the one being rotated
            _ltype(v2),
        ),
    )
    with numpy.errstate(all="ignore"):
        return _handler_of(v2)._wrap_result(  # note: _handler_of(v2)
            _flavor_of(v2),  # note: _flavor_of(v2)
            function(
                _lib_of(v1, v2),
                angle,
                *v1.azimuthal.elements,
                *v1.longitudinal.elements,
                *v2.azimuthal.elements,
                *v2.longitudinal.elements,
            ),
            returns,
            1,
        )
Beispiel #4
0
def dispatch(
    rtol: typing.Any,
    atol: typing.Any,
    equal_nan: typing.Any,
    v1: typing.Any,
    v2: typing.Any,
) -> typing.Any:
    function, *returns = _from_signature(
        __name__,
        dispatch_map,
        (
            _aztype(v1),
            _aztype(v2),
        ),
    )
    with numpy.errstate(all="ignore"):
        return _handler_of(v1, v2)._wrap_result(
            _flavor_of(v1, v2),
            function(
                _lib_of(v1, v2),
                rtol,
                atol,
                equal_nan,
                *v1.azimuthal.elements,
                *v2.azimuthal.elements,
            ),
            returns,
            2,
        )
Beispiel #5
0
def dispatch(factor: typing.Any, v: typing.Any) -> typing.Any:
    function, *returns = _from_signature(
        __name__,
        dispatch_map,
        (
            _aztype(v),
            _ltype(v),
        ),
    )
    with numpy.errstate(all="ignore"):
        return v._wrap_result(
            _flavor_of(v),
            function(v.lib, factor, *v.azimuthal.elements,
                     *v.longitudinal.elements),
            returns,
            1,
        )
Beispiel #6
0
def dispatch(u: typing.Any, i: typing.Any, j: typing.Any, k: typing.Any,
             vec: typing.Any) -> typing.Any:
    function, *returns = _from_signature(
        __name__,
        dispatch_map,
        (
            _aztype(vec),
            _ltype(vec),
        ),
    )
    with numpy.errstate(all="ignore"):
        return vec._wrap_result(
            _flavor_of(vec),
            function(vec.lib, u, i, j, k, *vec.azimuthal.elements,
                     *vec.longitudinal.elements),
            returns,
            1,
        )
Beispiel #7
0
def dispatch(obj: typing.Any, v: typing.Any) -> typing.Any:
    function, *returns = _from_signature(
        __name__,
        dispatch_map,
        (
            _aztype(v),
            _ltype(v),
            _ttype(v),
        ),
    )
    with numpy.errstate(all="ignore"):
        return v._wrap_result(
            _flavor_of(v),
            function(v.lib, obj["xx"], obj["xy"], obj["xz"], obj["xt"],
                     obj["yx"], obj["yy"], obj["yz"], obj["yt"], obj["zx"],
                     obj["zy"], obj["zz"], obj["zt"], obj["tx"], obj["ty"],
                     obj["tz"], obj["tt"], *v.azimuthal.elements,
                     *v.longitudinal.elements, *v.temporal.elements),
            returns,
            1,
        )