Sample

Contains information about a given sample and related methods to a sample.

class mundo.api.sample.SampleState(
value
)

Represents the available states a sample can have. READY denotes that the sample is prepared and ready to use. QUEUED denotes that the sample is queued to be run. RUNNING denotes that the sample is currently being run. DONE denotes that the sample has finished analysis. PAUSED denotes that the analysis has been paused with this sample ERROR denotes that the analysis failed fatally for this sample (only the currently running sample can be paused).

READY = 'READY'
QUEUED = 'QUEUED'
RUNNING = 'RUNNING'
PAUSED = 'PAUSED'
DONE = 'DONE'
ERROR = 'ERROR'
class mundo.api.sample.Sample(
index: int,
row: int,
column: int,
data: Dict[str, Any]
)

Contains information of a given sample. Used in the GUI to view and set sample settings.

__init__(
index: int,
row: int,
column: int,
data: Dict[str, Any]
) None

Initializes required information about a sample.

Parameters
  • index – The index of the sample

  • row – The row of the sample

  • column – The column of the sample

  • data – The saved serialized data for the sample

property position: Tuple[Optional[float], Optional[float], Optional[float]]

Gets this samples current target position (coordinates) in the system.

property safe_position: Tuple[Optional[float], Optional[float], Optional[float]]

Gets this samples safe target position (coordinates) in the system. This position will be a small distance away from the actual target position to allow the probe to move freely between samples, without the risk of touching the sample platform.

property index

Gets this samples current index

property row: int

Gets this samples current row

property column: int

Gets this samples current column.

property sample_time: Optional[int]

Gets this samples current sample time.

property state: mundo.api.sample.SampleState

Gets this samples current state

property name: Optional[str]

The name of the sample.

property description: Optional[str]

Gets this samples description

serialize() Dict[str, Any]

Serializes the sample into a JSON encodable dictionary containing the properties of the sample.

Returns

A JSON encodable dictionary containing the sample data

class mundo.api.sample.SampleCollection(
data: Dict[str, Any]
)

A collection of samples.

__init__(
data: Dict[str, Any]
) None

Initializes sample list based on platform configurations

Parameters

data – The saved serialized data

property samples: List[List[mundo.api.sample.Sample]]

Samples in the session

property rows: int

Number of rows

property columns: int

Number of columns

total_samples_done() int

Calculates the number of samples that are done or has failed.

Returns

The number of samples that have the state SampleState.DONE, or state SampleState.ERROR

get(
row: int,
column: int
) Optional[mundo.api.sample.Sample]

Get a sample in the sample collection based on row and column. Rows and columns are indexed from 0 and upwards.

Parameters
  • row – The row of the sample to get

  • column – The column of the sample to get

Returns

The sample at row and column, or None if no sample is positioned at the specified row and column

resize(
rows: int,
columns: int
) bool

Resizes the sample collection.

Parameters
  • rows – The new number of rows

  • columns – The new number of columns

Returns

True if the sample collections was resized. False otherwise

serialize() Dict[str, Any]

Serializes the sample collection into a JSON encodable dictionary containing the data of each stored sample.

Returns

A JSON encodable dictionary containing the collection data