Ensure complex nans are used for complex data
()
| 758 | |
| 759 | @requires_scipy |
| 760 | def test_interpolators_complex_out_of_bounds(): |
| 761 | """Ensure complex nans are used for complex data""" |
| 762 | |
| 763 | xi = np.array([-1, 0, 1, 2, 5], dtype=np.float64) |
| 764 | yi = np.exp(1j * xi) |
| 765 | x = np.array([-2, 1, 6], dtype=np.float64) |
| 766 | |
| 767 | expected = np.array( |
| 768 | [np.nan + np.nan * 1j, np.exp(1j), np.nan + np.nan * 1j], dtype=yi.dtype |
| 769 | ) |
| 770 | |
| 771 | for method, interpolator in [ |
| 772 | ("linear", NumpyInterpolator), |
| 773 | ("linear", ScipyInterpolator), |
| 774 | ]: |
| 775 | f = interpolator(xi, yi, method=method) |
| 776 | actual = f(x) |
| 777 | assert_array_equal(actual, expected) |
| 778 | |
| 779 | |
| 780 | @requires_scipy |
nothing calls this directly
no test coverage detected
searching dependent graphs…