Module src.qollib.strings.np_shape_parser

Functions

def parse_shape(string: str) ‑> tuple

Parses a numpy like shape string, e.g. [0:,42:1337] :returns: a tuple of slices that can be used with numpy arrays

def shape_slices_to_string(shape: tuple) ‑> str
def to_int(string: str) ‑> Optional[int]

:returns: an integer if the string is numeric

def to_slice(string: str, delimiter: str = ':') ‑> slice

:returns: a slice with start and stop taken from the string, seperated by delimiter, e.g. 3:7