MCPcopy Index your code
hub / github.com/pydata/xarray / source_ndarray

Function source_ndarray

xarray/tests/__init__.py:297–307  ·  view source on GitHub ↗

Given an ndarray, return the base object which holds its memory, or the object itself.

(array)

Source from the content-addressed store, hash-verified

295
296
297def source_ndarray(array):
298 """Given an ndarray, return the base object which holds its memory, or the
299 object itself.
300 """
301 with warnings.catch_warnings():
302 warnings.filterwarnings("ignore", "DatetimeIndex.base")
303 warnings.filterwarnings("ignore", "TimedeltaIndex.base")
304 base = getattr(array, "base", np.asarray(array).base)
305 if base is None:
306 base = array
307 return base
308
309
310def format_record(record) -> str:

Callers 14

test_align_nocopyMethod · 0.90
test_broadcast_nocopyMethod · 0.90
test_copyMethod · 0.90
test_align_copyMethod · 0.90
test_copyMethod · 0.90
test_copyMethod · 0.90
test_deepcopyMethod · 0.90
test_copyMethod · 0.90
test_valuesMethod · 0.90
test_inplace_mathMethod · 0.90

Calls

no outgoing calls

Tested by 14

test_align_nocopyMethod · 0.72
test_broadcast_nocopyMethod · 0.72
test_copyMethod · 0.72
test_align_copyMethod · 0.72
test_copyMethod · 0.72
test_copyMethod · 0.72
test_deepcopyMethod · 0.72
test_copyMethod · 0.72
test_valuesMethod · 0.72
test_inplace_mathMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…