pylabrobot.resources.tip_tracker.TipTracker#

class pylabrobot.resources.tip_tracker.TipTracker(thing: str, holder: TipSpot | None = None)#

Bases: SerializableMixin

A tip tracker tracks tip operations and raises errors if the tip operations are invalid.

With a holder, the tip spot it is a view on, the tip is the spot’s child in the resource tree and nowhere else: the tracker reads the tree, and its operations move the tip in it. Whether it is disabled is the spot’s to say. An uncommitted operation keeps only what the spot held before it, to report and to roll back to.

Attributes

has_tip

Whether the tip tracker has a tip.

is_disabled

Methods

__init__(thing[, holder])

add_tip(tip[, origin, commit])

Update the pending state with the operation, if the operation is valid.

clear()

Clear the history.

commit()

Commit the pending operations.

disable()

Disable the tip tracker.

enable()

Enable the tip tracker.

get_tip()

Get the committed tip.

get_tip_origin()

Get the origin of the current tip, if known.

load_state(state)

Load a saved tip tracker state.

register_callback(callback)

remove_tip([commit])

Update the pending state with the operation, if the operation is valid

rollback()

Rollback the pending operations.

serialize()

Serialize the state of the tip tracker.

Parameters: