-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add missing super __init__ in subclasses #20436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
696929f
3855452
197d04d
650160a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
import numpy as np | ||
|
||
from matplotlib import _text_helpers, dviread, font_manager, rcParams | ||
from matplotlib import _text_helpers, dviread, font_manager | ||
from matplotlib.font_manager import FontProperties, get_font | ||
from matplotlib.ft2font import LOAD_NO_HINTING, LOAD_TARGET_LIGHT | ||
from matplotlib.mathtext import MathTextParser | ||
|
@@ -385,11 +385,11 @@ def __init__(self, xy, s, size=None, prop=None, | |
|
||
self._cached_vertices = None | ||
s, ismath = Text(usetex=usetex)._preprocess_math(s) | ||
self._vertices, self._codes = text_to_path.get_text_path( | ||
prop, s, ismath=ismath) | ||
super().__init__( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps rather use fast_from_codes_and_verts for speed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a class method / constructor, though? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah yes. Oh well, I guess this isn't a bottleneck... |
||
*text_to_path.get_text_path(prop, s, ismath=ismath), | ||
_interpolation_steps=_interpolation_steps, | ||
readonly=True) | ||
self._should_simplify = False | ||
self._simplify_threshold = rcParams['path.simplify_threshold'] | ||
self._interpolation_steps = _interpolation_steps | ||
|
||
def set_size(self, size): | ||
"""Set the text size.""" | ||
|
@@ -427,4 +427,5 @@ def _revalidate_path(self): | |
.scale(self._size / text_to_path.FONT_SCALE) | ||
.translate(*self._xy)) | ||
self._cached_vertices = tr.transform(self._vertices) | ||
self._cached_vertices.flags.writeable = False | ||
self._invalid = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are none of these really ever tested? Maybe beyond this PR, but they should be if they aren't...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're almost all unused, which I guess is why they're deprecated. For the ones that are used, I assume they all get
.set_canvas_size
called first, which sets the things that were missed in the super__init__
.