(ndim, boundary)
| 805 | |
| 806 | |
| 807 | def coerce_boundary(ndim, boundary): |
| 808 | default = "none" |
| 809 | if boundary is None: |
| 810 | boundary = default |
| 811 | if not isinstance(boundary, (tuple, dict)): |
| 812 | boundary = (boundary,) * ndim |
| 813 | if isinstance(boundary, tuple): |
| 814 | boundary = dict(zip(range(ndim), boundary)) |
| 815 | if isinstance(boundary, dict): |
| 816 | boundary = {ax: boundary.get(ax, default) for ax in range(ndim)} |
| 817 | return boundary |
| 818 | |
| 819 | |
| 820 | @derived_from(np.lib.stride_tricks) |
no test coverage detected