chemios package

Subpackages

Submodules

chemios.utils module

/*
  • Useful Utilities

*/

class chemios.utils.SerialTestClass[source]

Bases: object

A serial port test class using a mock port

chemios.utils.convert_to_lists(df)[source]

Convert data frame to list of lists

chemios.utils.discover_serial_ports()[source]

Lists serial port names

Raises:EnvironmentError – On unsupported or unknown platforms
Returns:A list of the serial ports available on the system
chemios.utils.import_module(name)[source]

Import a module from a string

chemios.utils.serial_write(ser, cmd)[source]

General Serial Writing Method

Parameters:
  • ( (Ser) – object:): Serial object from pyserial
  • cmd (str) – String being sent
  • handle (str) – Function handle (needed for error reporting)
  • output (bool) – If true, fucntion returns output/errors from serial defvece
chemios.utils.sio_write(sio, cmd, output=False, exp=None, ctx='Device', timeout=2)[source]

General Serial Writing Method with reading response

Parameters:
  • ( (sio) – object:): io.Wrapper object from pyserial
  • cmd (str) – String being sent
  • exp (str) – Expected response (optional)
  • ctx (str) – The device being communicated with. Used for debug messages (optional)
  • output (bool) – If true, function returns output/errors from serial device. Defaults to false.
  • timeout (int) – Timeout in seconds. Defaults to 2 seconds.
Returns:

Response from the serial buffer.

chemios.utils.write_i2c(string, bus, address)[source]

Method for writing via i2c

Module contents