Procedure class

class pymeasure.experiment.procedure.Procedure(**kwargs)

Provides the base class of a procedure to organize the experiment execution. Procedures should be run by Workers to ensure that asynchronous execution is properly managed.

procedure = Procedure()
results = Results(procedure, data_filename)
worker = Worker(results, port)
worker.start()

Inheriting classes should define the startup, execute, and shutdown methods as needed. The shutdown method is called even with a software exception or abort event during the execute method.

If keyword arguments are provided, they are added to the object as attributes.

check_parameters()

Raises an exception if any parameter is missing before calling the associated function. Ensures that each value can be set and got, which should cast it into the right format. Used as a decorator @check_parameters on the startup method

execute()

Preforms the commands needed for the measurement itself. During execution the shutdown method will always be run following this method. This includes when Exceptions are raised.

gen_measurement()

Create MEASURE and DATA_COLUMNS variables for get_datapoint method.

parameter_objects()

Returns a dictionary of all the Parameter objects and grabs any current values that are not in the default definitions

parameter_values()

Returns a dictionary of all the Parameter values and grabs any current values that are not in the default definitions

parameters_are_set()

Returns True if all parameters are set

refresh_parameters()

Enforces that all the parameters are re-cast and updated in the meta dictionary

set_parameters(parameters, except_missing=True)

Sets a dictionary of parameters and raises an exception if additional parameters are present if except_missing is True

shutdown()

Executes the commands necessary to shut down the instruments and leave them in a safe state. This method is always run at the end.

startup()

Executes the commands needed at the start-up of the measurement

class pymeasure.experiment.procedure.UnknownProcedure(parameters)

Handles the case when a Procedure object can not be imported during loading in the Results class

startup()

Executes the commands needed at the start-up of the measurement