Servers

Submodules

mischbares.server.autolab_server module

autolab dirver

class mischbares.server.autolab_server.ReturnClass(*, parameters: dict = None, data: dict = None)[source]

Bases: pydantic.main.BaseModel

define a return class for returning the result with pydantic

data: dict
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'data': FieldInfo(annotation=dict, required=False), 'parameters': FieldInfo(annotation=dict, required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

parameters: dict
mischbares.server.autolab_server.abort()[source]

abort the current procedure.

Returns

return class with the parameters and the data.

Return type

retc (ReturnClass)

mischbares.server.autolab_server.applied_potential()[source]

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

Returns

return class with the parameters and the data.

Return type

retc (ReturnClass)

mischbares.server.autolab_server.current()[source]

get the current of the instrument vs. reference electrode.

Returns

current value.

Return type

current (float)

mischbares.server.autolab_server.disconnect()[source]

disconnect from the instrument.

mischbares.server.autolab_server.health_check()[source]

health check to see if the server is up and running :returns: status :rtype: dict

mischbares.server.autolab_server.main()[source]

main function to run the server.

mischbares.server.autolab_server.measure_status()[source]

check if the instrument is measuring.

Returns

return class with the parameters and the data

Return type

retc (ReturnClass)

async mischbares.server.autolab_server.perform_measurement(procedure: str, plot_type: str, parse_instruction, save_dir: str, setpoints, current_range: str = '1mA', on_off_status: str = 'off', optional_name: Optional[str] = None, measure_at_ocp: bool = False, measurement_id: Optional[int] = 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. Defaults to None.

  • current_range (str) – the current range of the instrument. 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) – measure at ocp. Defaults to False.

Returns

return class with the parameters and the data

Return type

retc (ReturnClass)

mischbares.server.autolab_server.potential()[source]

get the current of the instrument vs. reference electrode.

Returns

return class with the parameters and the data.

Return type

retc (ReturnClass)

mischbares.server.autolab_server.reset()[source]

reset the autolab driver

Returns

return class with the parameters and the data.

Return type

retc (ReturnClass)

mischbares.server.autolab_server.retrieve(save_dir: str, file_name: str)[source]

retrieve the data from the nox file.

Parameters
  • safepath (str) – the path of the nox file.

  • file_name (str) – the name of the nox file.

Returns

return class with the parameters and the data

Return type

retc (ReturnClass)

mischbares.server.autolab_server.set_cell(onoff: str)[source]

turn the cell on or off.

Parameters

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

Returns

return class with the parameters and the data.

Return type

retc (ReturnClass)

mischbares.server.autolab_server.set_current_range(crange: str)[source]

set the current range of the instrument.

Returns

return class with the parameters and the data

Return type

retc (ReturnClass)

mischbares.server.autolab_server.set_stability(stability: str)[source]

set the stability of the instrument.

Parameters

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

Returns

return class with the parameters and the data.

Return type

retc (ReturnClass)

mischbares.server.autolab_server.startup_event()[source]

startup event for initializing the autolab driver

async mischbares.server.autolab_server.websocket_messages(websocket: starlette.websockets.WebSocket)[source]

websocket for the autolab driver and visualise the results.

Parameters

websocket (WebSocket) – _description_

Module contents