Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit87885e7

Browse files
authored
Merge pull request#7987 from QuLogic/master-Vega-deprecation
TST: Add vega deprecations to tests on master
2 parents5652c66 +2bd330d commit87885e7

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

‎lib/matplotlib/tests/test_colors.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -608,19 +608,22 @@ def test_pandas_iterable():
608608
assert_array_equal(cm1.colors,cm2.colors)
609609

610610

611-
deftest_colormap_reversing():
611+
@pytest.mark.parametrize('name',cm.cmap_d)
612+
deftest_colormap_reversing(name):
612613
"""Check the generated _lut data of a colormap and corresponding
613614
reversed colormap if they are almost the same."""
614-
fornameincm.cmap_d:
615-
withwarnings.catch_warnings(record=True)asw:
616-
warnings.simplefilter('always')
617-
cmap=plt.get_cmap(name)
618-
assertlen(w)== (1ifnamein ('spectral','spectral_r')else0)
619-
cmap_r=cmap.reversed()
620-
ifnotcmap_r._isinit:
621-
cmap._init()
622-
cmap_r._init()
623-
assert_array_almost_equal(cmap._lut[:-3],cmap_r._lut[-4::-1])
615+
should_have_warning= {'spectral','spectral_r','Vega10','Vega10_r',
616+
'Vega20','Vega20_r','Vega20b','Vega20b_r',
617+
'Vega20c','Vega20c_r'}
618+
withwarnings.catch_warnings(record=True)asw:
619+
warnings.simplefilter('always')
620+
cmap=plt.get_cmap(name)
621+
assertlen(w)== (1ifnameinshould_have_warningelse0)
622+
cmap_r=cmap.reversed()
623+
ifnotcmap_r._isinit:
624+
cmap._init()
625+
cmap_r._init()
626+
assert_array_almost_equal(cmap._lut[:-3],cmap_r._lut[-4::-1])
624627

625628

626629
@cleanup

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp