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

Skip to content

Commit 3c9b031

Browse files
committed
Remove deprecated mathtext classes.
1 parent b2a2ed1 commit 3c9b031

3 files changed

Lines changed: 11 additions & 79 deletions

File tree

doc/api/next_api_changes/removals/19900-ES.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
mathtext ``Glue`` classes
2+
~~~~~~~~~~~~~~~~~~~~~~~~~
3+
The following have been removed from `matplotlib.mathtext`:
4+
5+
* *copy* parameter of ``mathtext.Glue``
6+
* ``mathtext.Glue.glue_subtype``
7+
* ``mathtext.GlueSpec``
8+
* ``Fil``, ``Fill``, ``Filll``, ``NegFil``, ``NegFill``, ``NegFilll``, and
9+
``SsGlue``; directly construct glue instances with ``Glue("fil")``, etc.
10+
111
*ismath* parameter of ``draw_tex``
212
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313
The *ismath* parameter of the ``draw_tex`` method of all renderer classes has

lib/matplotlib/_mathtext.py

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,10 +1546,7 @@ class Glue(Node):
15461546
it's easier to stick to what TeX does.)
15471547
"""
15481548

1549-
glue_subtype = _api.deprecated("3.3")(property(lambda self: "normal"))
1550-
1551-
@_api.delete_parameter("3.3", "copy")
1552-
def __init__(self, glue_type, copy=False):
1549+
def __init__(self, glue_type):
15531550
super().__init__()
15541551
if isinstance(glue_type, str):
15551552
glue_spec = _GlueSpec._named[glue_type]
@@ -1571,51 +1568,6 @@ def grow(self):
15711568
self.glue_spec = g._replace(width=g.width * GROW_FACTOR)
15721569

15731570

1574-
# Some convenient ways to get common kinds of glue
1575-
1576-
1577-
@_api.deprecated("3.3", alternative="Glue('fil')")
1578-
class Fil(Glue):
1579-
def __init__(self):
1580-
super().__init__('fil')
1581-
1582-
1583-
@_api.deprecated("3.3", alternative="Glue('fill')")
1584-
class Fill(Glue):
1585-
def __init__(self):
1586-
super().__init__('fill')
1587-
1588-
1589-
@_api.deprecated("3.3", alternative="Glue('filll')")
1590-
class Filll(Glue):
1591-
def __init__(self):
1592-
super().__init__('filll')
1593-
1594-
1595-
@_api.deprecated("3.3", alternative="Glue('neg_fil')")
1596-
class NegFil(Glue):
1597-
def __init__(self):
1598-
super().__init__('neg_fil')
1599-
1600-
1601-
@_api.deprecated("3.3", alternative="Glue('neg_fill')")
1602-
class NegFill(Glue):
1603-
def __init__(self):
1604-
super().__init__('neg_fill')
1605-
1606-
1607-
@_api.deprecated("3.3", alternative="Glue('neg_filll')")
1608-
class NegFilll(Glue):
1609-
def __init__(self):
1610-
super().__init__('neg_filll')
1611-
1612-
1613-
@_api.deprecated("3.3", alternative="Glue('ss')")
1614-
class SsGlue(Glue):
1615-
def __init__(self):
1616-
super().__init__('ss')
1617-
1618-
16191571
class HCentered(Hlist):
16201572
"""
16211573
A convenience class to create an `Hlist` whose contents are

lib/matplotlib/mathtext.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -359,36 +359,6 @@ class MathTextWarning(Warning):
359359
pass
360360

361361

362-
@_api.deprecated("3.3")
363-
class GlueSpec:
364-
"""See `Glue`."""
365-
366-
def __init__(self, width=0., stretch=0., stretch_order=0,
367-
shrink=0., shrink_order=0):
368-
self.width = width
369-
self.stretch = stretch
370-
self.stretch_order = stretch_order
371-
self.shrink = shrink
372-
self.shrink_order = shrink_order
373-
374-
def copy(self):
375-
return GlueSpec(
376-
self.width,
377-
self.stretch,
378-
self.stretch_order,
379-
self.shrink,
380-
self.shrink_order)
381-
382-
@classmethod
383-
def factory(cls, glue_type):
384-
return cls._types[glue_type]
385-
386-
387-
with _api.suppress_matplotlib_deprecation_warning():
388-
GlueSpec._types = {k: GlueSpec(**v._asdict())
389-
for k, v in _mathtext._GlueSpec._named.items()}
390-
391-
392362
@_api.deprecated("3.4")
393363
def ship(ox, oy, box):
394364
_mathtext.ship(ox, oy, box)

0 commit comments

Comments
 (0)