aistore.sdk.multiobj.object_range

View as Markdown

Module Contents

Classes

NameDescription
ObjectRangeClass representing a range of object names

API

class aistore.sdk.multiobj.object_range.ObjectRange(
prefix: str,
min_index: int = None,
max_index: int = None,
pad_width: int = 0,
step: int = 1,
suffix: str = ''
)

Bases: ObjectCollection

Class representing a range of object names

Parameters:

prefix
str

Prefix contained in all names of objects

min_index
intDefaults to None

Starting index in the name of objects

max_index
intDefaults to None

Last index in the name of all objects

pad_width
intDefaults to 0

Left-pad indices with zeros up to the width provided, e.g. pad_width = 3 will transform 1 to 001

step
intDefaults to 1

Size of iterator steps between each item

suffix
strDefaults to ''

Suffix at the end of all object names

_max_index
_min_index
aistore.sdk.multiobj.object_range.ObjectRange.__iter__() -> typing.Iterator[str]
aistore.sdk.multiobj.object_range.ObjectRange.__str__() -> str
aistore.sdk.multiobj.object_range.ObjectRange._indices_set() -> bool
aistore.sdk.multiobj.object_range.ObjectRange._validate_indices(
min_index,
max_index,
pad_width
)
staticmethod

Raises:

  • InvalidObjectRangeIndex: If the indices passed to the range are not valid
aistore.sdk.multiobj.object_range.ObjectRange.from_string(
range_string: str
)
classmethod

Construct an ObjectRange instance from a valid range string like ‘input-{00..99..1}.txt’

Parameters:

range_string
str

The range string to parse

Returns:

An instance of the ObjectRange class

aistore.sdk.multiobj.object_range.ObjectRange.get_value()