(ndim, boundary)
| 825 | |
| 826 | |
| 827 | def coerce_boundary(ndim, boundary): |
| 828 | default = "none" |
| 829 | if boundary is None: |
| 830 | boundary = default |
| 831 | if not isinstance(boundary, (tuple, dict)): |
| 832 | boundary = (boundary,) * ndim |
| 833 | if isinstance(boundary, tuple): |
| 834 | boundary = dict(zip(range(ndim), boundary)) |
| 835 | if isinstance(boundary, dict): |
| 836 | boundary = {ax: boundary.get(ax, default) for ax in range(ndim)} |
| 837 | return boundary |
| 838 | |
| 839 | |
| 840 | @derived_from(np.lib.stride_tricks) |
no test coverage detected