(doc)
| 208 | |
| 209 | |
| 210 | def test_passthrough_arguments(doc): |
| 211 | assert doc(m.vec_passthrough) == ( |
| 212 | "vec_passthrough(" |
| 213 | + ", ".join( |
| 214 | [ |
| 215 | "arg0: typing.SupportsFloat | typing.SupportsIndex", |
| 216 | "arg1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]", |
| 217 | "arg2: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]", |
| 218 | "arg3: typing.Annotated[numpy.typing.ArrayLike, numpy.int32]", |
| 219 | "arg4: typing.SupportsInt | typing.SupportsIndex", |
| 220 | "arg5: m.numpy_vectorize.NonPODClass", |
| 221 | "arg6: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]", |
| 222 | ] |
| 223 | ) |
| 224 | + ") -> object" |
| 225 | ) |
| 226 | |
| 227 | b = np.array([[10, 20, 30]], dtype="float64") |
| 228 | c = np.array([100, 200]) # NOT a vectorized argument |
| 229 | d = np.array([[1000], [2000], [3000]], dtype="int") |
| 230 | g = np.array([[1000000, 2000000, 3000000]], dtype="int") # requires casting |
| 231 | assert np.all( |
| 232 | m.vec_passthrough(1, b, c, d, 10000, m.NonPODClass(100000), g) |
| 233 | == np.array( |
| 234 | [ |
| 235 | [1111111, 2111121, 3111131], |
| 236 | [1112111, 2112121, 3112131], |
| 237 | [1113111, 2113121, 3113131], |
| 238 | ] |
| 239 | ) |
| 240 | ) |
| 241 | |
| 242 | |
| 243 | def test_method_vectorization(): |
nothing calls this directly
no test coverage detected