Add your issue here
If the # ty: ignore[invalid-return-type] comment is removed from the following code
|
zr = xpx.union1d(w.za, z_) |
|
|
|
fr = glass.arraytools.ndinterp( |
|
zr, |
|
z, |
|
f, |
|
left=0.0, |
|
right=0.0, |
|
) * glass.arraytools.ndinterp(zr, w.za, w.wa) |
|
return zr, fr # ty: ignore[invalid-return-type] |
then we get this error upon running ty check
error[invalid-return-type]: Return type does not match returned value
--> glass/shells.py:529:12
|
529 | return zr, fr
| ^^^^^^ expected `tuple[ndarray[tuple[Any, ...], dtype[float64]] | jax._src.basearray.Array | array_api_strict._array_object.Array, ndarray[tuple[Any, ...], dtype[float64]] | jax._src.basearray.Array | array_api_strict._array_object.Array]`, found `tuple[array_api_extra._lib._utils._typing.Array, Unknown]`
|
::: glass/shells.py:482:6
|
482 | ) -> tuple[FloatArray, FloatArray]:
| ----------------------------- Expected `tuple[ndarray[tuple[Any, ...], dtype[float64]] | jax._src.basearray.Array | array_api_strict._array_object.Array, ndarray[tuple[Any, ...], dtype[float64]] | jax._src.basearray.Array | array_api_strict._array_object.Array]` because of return type
|
info: the first tuple element is not compatible: `Array` is not assignable to `ndarray[tuple[Any, ...], dtype[float64]] | jax._src.basearray.Array | array_api_strict._array_object.Array`
The Unknown type is coming from the xpx.union1d call. This could be "fixed" by changing line 520 to zr = xp.asarray(xpx.union1d(w.za, z_)).
Add your issue here
If the
# ty: ignore[invalid-return-type]comment is removed from the following codeglass/glass/shells.py
Lines 520 to 529 in 7e620f7
then we get this error upon running
ty checkThe
Unknowntype is coming from thexpx.union1dcall. This could be "fixed" by changing line 520 tozr = xp.asarray(xpx.union1d(w.za, z_)).