Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71de09a

Browse files
authored
Merge pull request #18201 from dstansby/color-depr
Remove mpl.colors deprecations for 3.4
2 parents efa8bb0 + e3e93ae commit 71de09a

File tree

5 files changed

+7
-24
lines changed

5 files changed

+7
-24
lines changed

doc/api/colors_api.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Classes
2020

2121
BoundaryNorm
2222
Colormap
23-
DivergingNorm
2423
LightSource
2524
LinearSegmentedColormap
2625
ListedColormap
@@ -47,5 +46,4 @@ Functions
4746
to_rgba_array
4847
is_color_like
4948
same_color
50-
makeMappingArray
5149
get_named_colors_mapping
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
`matplotlib.colors` removals
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
- ``makeMappingArray`` has been removed.
5+
- ``DivergingNorm`` has been renamed to `~matplotlib.colors.TwoSlopeNorm`.

doc/api/prev_api_changes/api_changes_3.2.0/deprecations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ to a NumPy array with ``np.asarray`` before processing it.
223223

224224
Colors
225225
~~~~~~
226-
The function `matplotlib.colors.makeMappingArray` is not considered part of
226+
The function ``matplotlib.colors.makeMappingArray`` is not considered part of
227227
the public API any longer. Thus, it's deprecated.
228228

229229
Using a string of single-character colors as a color sequence (e.g. "rgb") is

lib/matplotlib/colors.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
import matplotlib as mpl
8080
import numpy as np
81-
from matplotlib import cbook, docstring, scale
81+
from matplotlib import cbook, scale
8282
from ._color_data import BASE_COLORS, TABLEAU_COLORS, CSS4_COLORS, XKCD_COLORS
8383

8484

@@ -479,13 +479,6 @@ def _create_lookup_table(N, data, gamma=1.0):
479479
return np.clip(lut, 0.0, 1.0)
480480

481481

482-
@cbook.deprecated("3.2",
483-
addendum='This is not considered public API any longer.')
484-
@docstring.copy(_create_lookup_table)
485-
def makeMappingArray(N, data, gamma=1.0):
486-
return _create_lookup_table(N, data, gamma)
487-
488-
489482
def _warn_if_global_cmap_modified(cmap):
490483
if getattr(cmap, '_global', False):
491484
cbook.warn_deprecated(
@@ -763,9 +756,6 @@ def __init__(self, name, segmentdata, N=256, gamma=1.0):
763756
LinearSegmentedColormap.from_list
764757
Static method; factory function for generating a smoothly-varying
765758
LinearSegmentedColormap.
766-
767-
makeMappingArray
768-
For information about making a mapping array.
769759
"""
770760
# True only if all colors in map are identical; needed for contouring.
771761
self.monochrome = False
@@ -1185,11 +1175,6 @@ def __call__(self, value, clip=None):
11851175
return result
11861176

11871177

1188-
@cbook.deprecation.deprecated('3.2', alternative='TwoSlopeNorm')
1189-
class DivergingNorm(TwoSlopeNorm):
1190-
...
1191-
1192-
11931178
def _make_norm_from_scale(scale_cls, base_norm_cls=None, *, init=None):
11941179
"""
11951180
Decorator for building a `.Normalize` subclass from a `.Scale` subclass.

lib/matplotlib/tests/test_colors.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,11 +1138,6 @@ def test_hex_shorthand_notation():
11381138
assert mcolors.same_color("#123a", "#112233aa")
11391139

11401140

1141-
def test_DivergingNorm_deprecated():
1142-
with pytest.warns(cbook.MatplotlibDeprecationWarning):
1143-
norm = mcolors.DivergingNorm(vcenter=0)
1144-
1145-
11461141
def test_repr_png():
11471142
cmap = plt.get_cmap('viridis')
11481143
png = cmap._repr_png_()

0 commit comments

Comments
 (0)