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

Function broadcast_to

xarray/tests/arrays.py:126–136  ·  view source on GitHub ↗

Broadcasts an array to a specified shape, by either manipulating chunk keys or copying chunk manifest entries.

(
    x: "ConcatenatableArray", /, shape: tuple[int, ...]
)

Source from the content-addressed store, hash-verified

124
125@implements(np.broadcast_to)
126def broadcast_to(
127 x: "ConcatenatableArray", /, shape: tuple[int, ...]
128) -> "ConcatenatableArray":
129 """
130 Broadcasts an array to a specified shape, by either manipulating chunk keys or copying chunk manifest entries.
131 """
132 if not isinstance(x, ConcatenatableArray):
133 raise TypeError
134
135 result = np.broadcast_to(x._array, shape=shape)
136 return ConcatenatableArray(result)
137
138
139@implements(np.full_like)

Callers

nothing calls this directly

Calls 2

ConcatenatableArrayClass · 0.85
broadcast_toMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…