Skip to main content

Hardware Abstraction Layer (HAL) submodule of QOSST

Project description

qosst-hal

QOSST Logo

This project is part of QOSST.

Features

qosst-hal is the Hardware Abstract Layer. Its goal is to provide a unified interface for the hardware and for the higher classes in order for QOSST to be hardware-agnostic. In particular it includes abstraction layer for

  • Analog-to-Digital Converters (ADC);
  • Amperemeters;
  • Digital-to-Analog Converters (DAC);
  • DAC and ADC simultaneous;
  • Lasers;
  • Modulation Bias Controllers;
  • Polarisation Controllers;
  • Powermeters;
  • Power supplies;
  • Switches (optical switches);
  • Variable Optical Attenuators (VOA);
  • Voltmeters.

Installation

The module can be installed with the following command:

pip install qosst-hal

It is also possible to install it directly from the github repository:

pip install git+https://github.com/qosst/qosst-hal

It also possible to clone the repository before and install it with pip or poetry

git clone https://github.com/qosst/qosst-hal
cd qosst-alice
poetry install
pip install .

Documentation

The whole documentation can be found at https://qosst-hal.readthedocs.io/en/latest/

Usage

qosst-hal is not supposed to be used as a standalone package, but should be used to code your own hardware classes. There is a tutorial in the documentation on how to code your own hardware, but the basic idea is to subclass the basic hardware class and implement the abstract method of the abstract class. Here is an example on how to do with a VOA class for instance:

from qosst_hal.voa import GenericVOA

class MyVOA(GenericVOA):
    # According to the documentation, the VOA class should implement
    # open, set_value and close
    location: str
    inst: Whatever

    def __init__(self, location:str):
        self.location = location

    def open(self) -> None:
        self.inst = Whatever(self.location)

    def set_value(self, value:float) -> None:
        self.write(value)

    def close(self) -> None:
        self.inst.close()

The list of methods that should be implemented for each abstract class can be found in the code, or in the documentation.

Important: no actual implementations are released with QOSST.

License

As for all submodules of QOSST, qosst-hal is shipped under the Gnu General Public License v3.

Contributing

Contribution are more than welcomed, either by reporting issues or proposing merge requests. Please check the contributing section of the QOSST project fore more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qosst_hal-0.10.0.tar.gz (23.6 kB view hashes)

Uploaded Source

Built Distribution

qosst_hal-0.10.0-py3-none-any.whl (35.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page