Skip to content

Commit 019b0e7

Browse files
committed
TST: re-instate tests
1 parent 9aea3ed commit 019b0e7

28 files changed

+274
-19
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ def acorr(self, x, **kwargs):
19031903
----------
19041904
x : array-like
19051905
1906-
detrend : callable, default: `.mlab.detrend_none` (no detrending)
1906+
detrend : callable, default: no detrending
19071907
A detrending function applied to *x*. It must have the
19081908
signature ::
19091909
@@ -1967,7 +1967,7 @@ def acorr(self, x, **kwargs):
19671967
return self.xcorr(x, x, **kwargs)
19681968

19691969
@_preprocess_data(replace_names=["x", "y"], label_namer="y")
1970-
def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1970+
def xcorr(self, x, y, normed=True, detrend=None,
19711971
usevlines=True, maxlags=10, **kwargs):
19721972
r"""
19731973
Plot the cross correlation between *x* and *y*.
@@ -1980,7 +1980,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
19801980
----------
19811981
x, y : array-like of length n
19821982
1983-
detrend : callable, default: `.mlab.detrend_none` (no detrending)
1983+
detrend : callable, default: no detrending
19841984
A detrending function applied to *x* and *y*. It must have the
19851985
signature ::
19861986
@@ -2045,8 +2045,9 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
20452045
if Nx != len(y):
20462046
raise ValueError('x and y must be equal length')
20472047

2048-
x = detrend(np.asarray(x))
2049-
y = detrend(np.asarray(y))
2048+
if detrend is not None:
2049+
x = detrend(np.asarray(x))
2050+
y = detrend(np.asarray(y))
20502051

20512052
correls = np.correlate(x, y, mode="full")
20522053

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,8 +3005,8 @@ def vlines(
30053005
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
30063006
@_copy_docstring_and_deprecators(Axes.xcorr)
30073007
def xcorr(
3008-
x, y, normed=True, detrend=mlab.detrend_none, usevlines=True,
3009-
maxlags=10, *, data=None, **kwargs):
3008+
x, y, normed=True, detrend=None, usevlines=True, maxlags=10,
3009+
*, data=None, **kwargs):
30103010
return gca().xcorr(
30113011
x, y, normed=normed, detrend=detrend, usevlines=usevlines,
30123012
maxlags=maxlags,
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)