robotools.transform#

class robotools.transform.WellRandomizer(original_shape: Tuple[int, int], random_seed: int, *, mode: Literal['full', 'row', 'column'] = 'full')#

Bases: object

Helper object to randomize a set of well IDs within a MTP.

Methods

derandomize_wells(wells)

Derandomize the given wells with the random state and assignment specified in __init__.

randomize_wells(wells)

Randomize the given wells with the random state and assignment specified in __init__.

derandomize_wells(wells: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) ndarray#

Derandomize the given wells with the random state and assignment specified in __init__.

Parameters:
wellsarray-like

List or array of well ids

Returns:
derandomized_output_wellsndarray

Array of well ids

randomize_wells(wells: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) ndarray#

Randomize the given wells with the random state and assignment specified in __init__.

Parameters:
wellsarray-like

List or array of well ids

Returns:
randomizedndarray

Array of well ids

class robotools.transform.WellRotator(original_shape: Tuple[int, int])#

Bases: object

Helper object to rotate a set of well IDs within a MTP.

Methods

rotate_ccw(wells)

Rotate the given wells counterclockwise.

rotate_cw(wells)

Rotate the given wells clockwise.

rotate_ccw(wells: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) ndarray#

Rotate the given wells counterclockwise.

Parameters:
wellsarray-like

List or array of well ids

Returns:
rotatedndarray

Array of well ids

rotate_cw(wells: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) ndarray#

Rotate the given wells clockwise.

Parameters:
wellsarray-like

List or array of well ids

Returns:
rotatedndarray

Array of well ids

class robotools.transform.WellShifter(shape_A: Tuple[int, int], shape_B: Tuple[int, int], shifted_A01: str)#

Bases: object

Helper object to shift a set of well IDs within a MTP.

Methods

shift(wells)

Apply the forward-transformation.

unshift(wells)

Apply the reverse-transformation.

shift(wells: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) ndarray#

Apply the forward-transformation.

Parameters:
wellsarray-like

List or array of well ids on A

Returns:
shiftedndarray

Array of well ids on B (same shape)

unshift(wells: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) ndarray#

Apply the reverse-transformation.

Parameters:
wellsarray-like

List or array of well ids on B

Returns:
originalndarray

Array of well ids on A (same shape)

robotools.transform.make_well_array(R: int, C: int) ndarray#

Create a numpy array of well IDs.

Parameters:
Rint

Number of rows

Cint

Number of columns

Returns:
arrayndarray

Array of well IDs

robotools.transform.make_well_index_dict(R: int, C: int) Dict[str, Tuple[int, int]]#

Create a dictionary mapping well IDs to their numpy indices.

Parameters:
Rint

Number of rows

Cint

Number of columns

Returns:
indicesdict

Mapping of IDs to numpy-style indices