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 7b9cdec

Browse filesBrowse files
committed
Fix specgram test on NumPy 1.20.
In NumPy 1.20, the fft is slight different (more accurate?) and returns 0 as the last entry, instead of some small number ~1e-30. This causes a divide-by-zero warning in `log10`. However, this test doesn't really care about the spectrogram, just the frequencies, so we can change the scale to linear to avoid the warning.
1 parent 2ea0d63 commit 7b9cdec
Copy full SHA for 7b9cdec

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4452,7 +4452,7 @@ def test_specgram_angle():
44524452

44534453
def test_specgram_fs_none():
44544454
"""Test axes.specgram when Fs is None, should not throw error."""
4455-
spec, freqs, t, im = plt.specgram(np.ones(300), Fs=None)
4455+
spec, freqs, t, im = plt.specgram(np.ones(300), Fs=None, scale='linear')
44564456
xmin, xmax, freq0, freq1 = im.get_extent()
44574457
assert xmin == 32 and xmax == 96
44584458

0 commit comments

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