Rack
Rack(period=0.25)
Bases: Broadcaster
A class that represents a rack of instruments.
period
property
writable
add_instrument(instrument)
Adds an instrument to the rack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instrument
|
Instrument
|
The instrument to be added. |
required |
add_measurement(measurement)
Adds a measurement to the rack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
measurement
|
Measurement
|
The measurement to be added. |
required |
measure()
async
Executes all measurements in the rack and broadcasts the results.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary of results from the measurements. |
pause()
Pauses the measurements.
remove_instrument(name)
Removes an instrument from the rack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the instrument to be removed. |
required |
remove_measurement(name)
Removes a measurement from the rack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the measurement to be removed. |
required |
resume()
Resumes the measurements.
run(experiment=None)
async
Asynchronously runs the measurements at the specified period.
setup()
async
Sets up the rack by initializing the instruments and measurements.
shutdown()
async
Shuts down the rack and all its instruments.
teardown()
async
Cleans up the rack by stopping all measurements and instruments.