Drivers

Submodules

mischbares.driver.autolab_driver module

autolab dirver

class mischbares.driver.autolab_driver.Autolab(autolab_conf)[source]

Bases: object

autolab class for defining the base functions of Metrohm instrument.

abort()[source]

abort the current procedure.

add_cv_cycle_data_to_db(analyzed_data, db_procedure)[source]
applied_potential()[source]

get the applied potential of the instrument vs. reference electrode.

Returns

applied potential.

Return type

flaot

connect()[source]

connect to the instrument.

current()[source]

get the current of the instrument vs. reference electrode.

Returns

current value.

Return type

current (float)

disconnect()[source]

disconnect from the instrument.

async get_ocp_on_the_fly()[source]

get the on the fly OCP value as initial point for autolab procedures.

Returns

current value at ocp. potential (float): potential value at ocp.

Return type

current (float)

load_procedure(name)[source]

load a procedure.

Parameters

name (str) – name of the procedure.

measure_status()[source]

check if the instrument is measuring.

Returns

True if measuring, False if not.

Return type

bool

property optional_name

get the optional name.

Returns

optional name.

Return type

str

parse_nox(parse_instruction, save_dir=None, optional_name=None)[source]

parse the data from the saved nox file

Parameters
  • parse_instruction (str) – the instruction for parsing the data.

  • save_dir (str, optional) – save directory. Defaults to None.

  • optional_name (str, optional) – optional file name. Defaults to None.

Returns

extracted data

Return type

data (dict)

async perform_measurement(procedure, plot_type, parse_instruction, save_dir, setpoints=None, current_range='1mA', on_off_status='off', optional_name=None, measure_at_ocp=False, measurement_id=None)[source]

perform the measurement

Parameters
  • procedure (str) – the procedure to be performed.

  • plot_type (str) – the type of plot.

  • parse_instruction (list[str]) – the instruction for parsing the data.

  • save_dir (str) – save directory.

  • setpoints (dict) – the setpoints of the procedure.

  • current_range (str) – the current range. Defaults to “1mA”.

  • on_off_status (str) – the status of the instrument. Defaults to “off”.

  • optional_name (str) – optional file name. Defaults to None.

  • measure_at_ocp (bool) – whether to measure at ocp. Default is False.

  • db_procedure (object) – the procedure object from the database. Defaults to None.

Returns

extracted data from the nox file of the procedure.

Return type

data (dict)

potential()[source]

get the current of the instrument vs. reference electrode.

Returns

current pottential.

Return type

float

prepare_data_for_db(procedure_configuration, analyzed_data)[source]
reset()[source]

reset the instrument.

property save_dir

get the save directory.

Returns

save directory.

Return type

str

set_cell(onoff)[source]

turn the cell on or off.

Parameters

onoff (str) – “on” or “off” for the cell.

set_current_range(current_range)[source]

set the current range of the instrument.

Parameters

current_range (str) – set the current range of the instrument.

set_ocp_value(procedure, ocp_value)[source]

set the ocp potential or current of the procedure. :param procedure: name of the procedure. :type procedure: str :param ocp_value: ocp potential or current value. :type ocp_value: float

set_setpoints(procedure, setpoints, current_range)[source]

set the setpoints of the procedure.

Parameters
  • procedure (str) – name of the procedure.

  • setpoints (dict) – a dictionary of the procedure’s parameters.

  • current_range (str) – the current range of the instrument.

set_stability(stability)[source]

set the stability of the instrument.

Parameters

stability (str) – “high”, “low”.

async visualize_measurement(measurement_type, measurement_id=None)[source]

an async function to run while the instrument is measuring used for the visualizer.

Parameters

measurement_type (str) – the type of measurement for plotting.

Module contents