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

Method __array__

lib/matplotlib/tests/test_units.py:320–329  ·  view source on GitHub ↗
(self, dtype=None, copy=None)

Source from the content-addressed store, hash-verified

318 self._array = np.asanyarray(array)
319
320 def __array__(self, dtype=None, copy=None):
321 if dtype is not None and dtype != self._array.dtype:
322 if copy is not None and not copy:
323 raise ValueError(
324 f"Converting array from {self._array.dtype} to "
325 f"{dtype} requires a copy"
326 )
327
328 arr = np.asarray(self._array, dtype=dtype)
329 return (arr if not copy else np.copy(arr))
330
331 @property
332 def shape(self):

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected