MCPcopy Index your code
hub / github.com/pydata/xarray / test_interpolators_complex_out_of_bounds

Function test_interpolators_complex_out_of_bounds

xarray/tests/test_missing.py:760–777  ·  view source on GitHub ↗

Ensure complex nans are used for complex data

()

Source from the content-addressed store, hash-verified

758
759@requires_scipy
760def 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

Callers

nothing calls this directly

Calls 1

fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…