ramonhagenaars/nptyping

handling np.asarray

farnasirim opened this issue · 1 comments

In the following

def get_translation(dx, dy) -> NDArray[(3, 3), np.float32]:
    return np.asarray(
        [
            [1, 0, ],
            [0, 1, 0],
            [0, 0, 1],
        ],
        dtype=np.float32,
    )

I get a warning Expected type 'NDArray[Any, Union[floating[_32Bit], single]]', got 'ndarray' instead .

That warning comes from a static type checker such as MyPy or your IDE. Please continue in #34