MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_detrend_linear_2d

Method test_detrend_linear_2d

lib/matplotlib/tests/test_mlab.py:155–172  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

153 self.allclose(mlab.detrend_linear(input.tolist()), target)
154
155 def test_detrend_linear_2d(self):
156 input = np.vstack([self.sig_off,
157 self.sig_slope,
158 self.sig_slope + self.sig_off])
159 target = np.vstack([self.sig_zeros,
160 self.sig_zeros,
161 self.sig_zeros])
162 self.allclose(
163 mlab.detrend(input.T, key="linear", axis=0), target.T)
164 self.allclose(
165 mlab.detrend(input.T, key=mlab.detrend_linear, axis=0), target.T)
166 self.allclose(
167 mlab.detrend(input, key="linear", axis=1), target)
168 self.allclose(
169 mlab.detrend(input, key=mlab.detrend_linear, axis=1), target)
170
171 with pytest.raises(ValueError):
172 mlab.detrend_linear(self.sig_slope[np.newaxis])
173
174
175@pytest.mark.parametrize('iscomplex', [False, True],

Callers

nothing calls this directly

Calls 1

allcloseMethod · 0.95

Tested by

no test coverage detected