MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _fast_from_codes_and_verts

Method _fast_from_codes_and_verts

lib/matplotlib/path.py:162–188  ·  view source on GitHub ↗

Create a Path instance without the expense of calling the constructor. Parameters ---------- verts : array-like codes : array internals_from : Path or None If not None, another `Path` from which the attributes ``should_simplif

(cls, verts, codes, internals_from=None)

Source from the content-addressed store, hash-verified

160
161 @classmethod
162 def _fast_from_codes_and_verts(cls, verts, codes, internals_from=None):
163 """
164 Create a Path instance without the expense of calling the constructor.
165
166 Parameters
167 ----------
168 verts : array-like
169 codes : array
170 internals_from : Path or None
171 If not None, another `Path` from which the attributes
172 ``should_simplify``, ``simplify_threshold``, and
173 ``interpolation_steps`` will be copied. Note that ``readonly`` is
174 never copied, and always set to ``False`` by this constructor.
175 """
176 pth = cls.__new__(cls)
177 pth._vertices = _to_unmasked_float_array(verts)
178 pth._codes = codes
179 pth._readonly = False
180 if internals_from is not None:
181 pth._should_simplify = internals_from._should_simplify
182 pth._simplify_threshold = internals_from._simplify_threshold
183 pth._interpolation_steps = internals_from._interpolation_steps
184 else:
185 pth._should_simplify = True
186 pth._simplify_threshold = mpl.rcParams['path.simplify_threshold']
187 pth._interpolation_steps = 1
188 return pth
189
190 @classmethod
191 def _create_closed(cls, vertices):

Callers 4

cleanedMethod · 0.80
_revalidateMethod · 0.80

Calls 2

_to_unmasked_float_arrayFunction · 0.85
__new__Method · 0.45

Tested by

no test coverage detected