cohesivm.interfaces

This module contains the Interface Abstract Base Class and the implemented interfaces. The main responsibility is to establish a physical connection to the available contacts which are defined within the class.

class InterfaceType[source]

Bases: ABC

This class is used to check if the Measurement and Interface are compatible.

class HighLow[source]

Bases: InterfaceType

Consist of a “High” terminal which is the positive or high-voltage output used for sourcing voltage or current and a “Low” terminal which serves as the negative or low-voltage reference.

class Interface(pixel_dimensions: Shape | Dict[str, Shape])[source]

Bases: ABC

A child class implements the properties of the interface and a method which establishes a connection to the available contacts.

Parameters:

pixel_dimensions – The sizes and shapes of the pixels on the sample.

Required properties

_interface_type:

The InterfaceType of the interface which needs to correspond to the Measurement.

_interface_dimensions:

The Shape of the interface.

_contact_ids:

A list of strings which corresponds to the identifiers of the contacts.

_contact_positions:

A mapping of the _contact_ids and the positions of the contacts on the interface.

property name: str

Name of the interface which is the name of the class.

property interface_type: InterfaceType

Constant interface type object.

property interface_dimensions: Shape

The size and shape of this interface.

property contact_ids: List[str]

List of available contacts.

property contact_positions: Dict[str, Tuple[float, float]]

A dictionary which contains the positions of the contacts on the interface as tuples of floats. The coordinates are given in mm and the origin is in the bottom-left corner.

property pixel_dimensions: Dict[str, Shape]

The size and shape of the pixels on the sample.

select_contact(contact_id: str) None[source]

Checks if the contact value is valid and runs the _select_contact method for the actual contact selection.

Parameters:

contact_id – The ID of the contact.

Raises:

ValueError – If the contact is not available on the interface.

abstract _select_contact(contact_id: str) None[source]

Method to connect the interface to the specified contact.

Parameters:

contact_id – The ID of the contact.

Implemented Interfaces

class TrivialHighLow(pixel_dimensions: Shape)[source]

This interface is the conventional, single-point connection to a sample with one positive/high-voltage terminal and one negative/low-voltage terminal. It can be used if the selection of contacts is carried out manually (not recommended).

Parameters:

pixel_dimensions – The size and shape of the pixel on the sample.

class MA8X8(com_port: str, pixel_dimensions: Shape | Dict[str, Shape])[source]

The implementation of the Measurement Array 8x8 interface which consist of 64 front contacts and a single back contact on an area of 25 mm x 25 mm. The interface is controlled by an Arduino Nano Every board which is connected through a serial COM port.

Parameters:
  • com_port – The COM port of the Arduino Nano Every board.

  • pixel_dimensions – The sizes and shapes of the pixels on the sample.