Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 850bb2e

Browse filesBrowse files
committed
Restore code coverage (second attempt).
1 parent 379d128 commit 850bb2e
Copy full SHA for 850bb2e

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed

‎lib/matplotlib/tests/test_mlab.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_mlab.py
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,18 @@ def test_csd(self):
16301630
assert_allclose(fsp, freqs, atol=1e-06)
16311631
assert spec.shape == freqs.shape
16321632

1633+
def test_csd_padding(self):
1634+
"""Test zero padding of csd(). """
1635+
if self.NFFT_density is None: # for derived classes
1636+
return
1637+
sargs = dict(x=self.y, y=self.y+1, Fs=self.Fs, window=mlab.window_none,
1638+
sides=self.sides)
1639+
1640+
spec0, _ = mlab.csd(NFFT=self.NFFT_density, **sargs)
1641+
spec1, _ = mlab.csd(NFFT=self.NFFT_density*2, **sargs)
1642+
assert_almost_equal(np.sum(np.conjugate(spec0)*spec0).real,
1643+
np.sum(np.conjugate(spec1/2)*spec1/2).real)
1644+
16331645
def test_psd(self):
16341646
freqs = self.freqs_density
16351647
spec, fsp = mlab.psd(x=self.y,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.