Set empty-padded area in given dimension. Parameters ---------- padded : ndarray Array with the pad area which is modified inplace. axis : int Dimension with the pad area to set. width_pair : (int, int) Pair of widths that mark the pad area on both s
(padded, axis, width_pair, value_pair)
| 128 | |
| 129 | |
| 130 | def _set_pad_area(padded, axis, width_pair, value_pair): |
| 131 | """ |
| 132 | Set empty-padded area in given dimension. |
| 133 | |
| 134 | Parameters |
| 135 | ---------- |
| 136 | padded : ndarray |
| 137 | Array with the pad area which is modified inplace. |
| 138 | axis : int |
| 139 | Dimension with the pad area to set. |
| 140 | width_pair : (int, int) |
| 141 | Pair of widths that mark the pad area on both sides in the given |
| 142 | dimension. |
| 143 | value_pair : tuple of scalars or ndarrays |
| 144 | Values inserted into the pad area on each side. It must match or be |
| 145 | broadcastable to the shape of `arr`. |
| 146 | """ |
| 147 | left_slice = _slice_at_axis(slice(None, width_pair[0]), axis) |
| 148 | padded[left_slice] = value_pair[0] |
| 149 | |
| 150 | right_slice = _slice_at_axis( |
| 151 | slice(padded.shape[axis] - width_pair[1], None), axis) |
| 152 | padded[right_slice] = value_pair[1] |
| 153 | |
| 154 | |
| 155 | def _get_edges(padded, axis, width_pair): |
no test coverage detected
searching dependent graphs…