Skip to content

Commit

Permalink
Update main to beta (#88)
Browse files Browse the repository at this point in the history
* [QMI-0.45.0-beta.0] Update the version info to be `-beta.0` for the `main`.

* [#QMI-xxx] Sync code with Gitlab.

* [#QMI-xxx] Problem with pylint version

* [#QMI-xxx] Problem with pylint version

* [#QMI-xxx] Problem with pylint version

* [#QMI-xxx] Problem with pylint version

* [#QMI-xxx] Removing problematic code.

* [#QMI-xxx] Removing problematic code.

* commit badges

---------

Co-authored-by: Henri Ervasti <[email protected]>
Co-authored-by: Badge Bot <runner@fv-az1019-743.m5ch4o5xfz2e5czaqtqza4205h.dx.internal.cloudapp.net>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent aed1222 commit 0821670
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 18 deletions.
12 changes: 6 additions & 6 deletions .github/badges/pylint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,34 @@ QMI is developed by [QuTech](https://qutech.nl) to support advanced physics expe
However, other than its name and original purpose, there is nothing specifically *quantum* about QMI — it is potentially
useful in any environment where monitoring and control of measurement equipment is needed.

## Dependencies
The full functioning of this software is dependent on several external Python packages, dynamic libraries and drivers.
The following items are not delivered as part of this software and must be acquired and installed by the user separately,
when necessary for the use of a specific QMI driver:
- [ADwin.py](https://pypi.org/project/ADwin/)
- [libadwin.so, adwin32.dll, adwin64.dll](https://www.adwin.de/us/download/download.html)
- [aravis](https://github.com/AravisProject/aravis)
- [Aviosys HTTP API](https://aviosys.com/products/lib/httpapi.html)
- [Boston Micromachines DM SDK](https://bostonmicromachines.com/dmsdk/)
- [libdwf.dll, libdwf.so](https://digilent.com/reference/software/waveforms/waveforms-sdk/start)
- [JPE cacli.exe](https://www.jpe-innovations.com/wp-content/uploads/CPSC_v7.3.20201222.zip)
- [libmh150.so](https://www.picoquant.com/dl_software/MultiHarp150/MultiHarp150_160_V3_0.zip)
- [libhh400.so](https://www.picoquant.com/dl_software/HydraHarp400/HydraHarp400_SW_and_DLL_v3_0_0_3.zip)
- [libph300.so](https://www.picoquant.com/dl_software/PicoHarp300/PicoHarp300_SW_and_DLL_v3_0_0_3.zip)
- [libusb](https://libusb.info/)
- [Picotech PicoSDK ps3000a, PicoSDK ps4000a](https://www.picotech.com/downloads)
- [PyGObject](https://pypi.org/project/PyGObject/)
- [tcdbase.dll](https://www.qutools.com/files/quTAU_release/quTAU_Setup_4.3.3_win.exe), libtcdbase.so
- [RPi.GPIO](https://pypi.org/project/RPi.GPIO/)
- [Silicon Labs CP210x USB to UART Bridge](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers)
- [uldaq.py](https://pypi.org/project/uldaq/)
- [usbdll.dll](https://www.newport.com/software-and-drivers)
- [VCP driver](https://ftdichip.com/Drivers/vcp-drivers/)
- [stmcdc.inf](https://www.wieserlabs.com/products/radio-frequency/flexdds-ng-dual/FlexDDS-NG-ad9910_standalone.zip)
- [zhinst](https://pypi.org/project/zhinst/)

Usage of the third-party software, drivers or libraries can be subject to copyright and license terms of the provider. Please review their terms before using the software, driver or library.

## Installation

Currently, no PIP installation is possible. Please clone and setup with `python setup.py install`.
Expand Down
2 changes: 1 addition & 1 deletion documentation/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# -- Project information -----------------------------------------------------

project = 'QMI'
copyright = '2019-2023, QuTech — Delft, The Netherlands'
copyright = '2019-2024, QuTech — Delft, The Netherlands'
author = 'QuTech'

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion qmi/core/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def open(self) -> None:
via calls to instrument-specific methods.
Subclasses can extend this method to implement instrument-specific
initialization. If they do, they should call ``super().open()`` as a last statement, and return its value.
initialization. If they do, they should call ``super().open()`` as a last statement.
"""
self._check_is_closed()
self._is_open = True
Expand Down
2 changes: 1 addition & 1 deletion qmi/core/read_keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class KeyboardReader:
"""A class that implements non-blocking read of single lines from the keyboard."""

def __init__(self) -> None:
self._poll_keyboard = _PollKeyboard() # Instantiate platform-dependant keyboard line poller.
self._poll_keyboard = _PollKeyboard() # Instantiate platform-dependent keyboard line poller.

def poll_line(self) -> str:
"""Read a line from the keyboard without blocking.
Expand Down
2 changes: 1 addition & 1 deletion qmi/instruments/rohde_schwarz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Rohde & Schwarz, analog and vector signal generators.
The qmi.instruments.picoquant package provides support for:
The qmi.instruments.rohde_schwarz package provides support for:
- SGS100A model
- SMBV100A model.
"""
Expand Down
7 changes: 7 additions & 0 deletions qmi/instruments/teraxion/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""
Teraxion, narrowband tunable optical filters.
The qmi.instruments.teraxion package provides support for:
- Teraxion TFN model (tested).
"""
from qmi.instruments.teraxion.tfn import Teraxion_TFN
27 changes: 22 additions & 5 deletions qmi/instruments/teraxion/tfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# Global variable holding the logger for this module.
_logger = logging.getLogger(__name__)


class Teraxion_TFNElement(Enum):
"""
TeraXion TFN elements.
Expand Down Expand Up @@ -52,6 +53,7 @@ class Teraxion_TFNStatus:
tec_2_in_range: bool
tec_1_in_range: bool


@dataclass
class Teraxion_TFNSettings:
"""
Expand All @@ -65,6 +67,7 @@ class Teraxion_TFNSettings:
frequency: float
dispersion: float


@dataclass
class Teraxion_TFNChannelPlan:
"""
Expand All @@ -91,6 +94,7 @@ class Teraxion_TFNCommand:
num_received_bytes: Optional[int]
module_address: int = 0x30


T = TypeVar('T', bound=Teraxion_TFNCommand)


Expand Down Expand Up @@ -137,6 +141,7 @@ class Teraxion_TFNCommand_GetRTDTemperature(Teraxion_TFNCommand):
command_id = 0x17
num_received_bytes = 6


class Teraxion_TFNCommand_EnableDevice(Teraxion_TFNCommand):
"""
Command to enable the TFN.
Expand All @@ -145,6 +150,7 @@ class Teraxion_TFNCommand_EnableDevice(Teraxion_TFNCommand):
command_id = 0x1E
num_received_bytes = 4


class Teraxion_TFNCommand_DisableDevice(Teraxion_TFNCommand):
"""
Command to disable the TFN.
Expand All @@ -153,6 +159,7 @@ class Teraxion_TFNCommand_DisableDevice(Teraxion_TFNCommand):
command_id = 0x1F
num_received_bytes = 4


class Teraxion_TFNCommand_GetStartupByte(Teraxion_TFNCommand):
"""
Command to get the startup byte of the TFN.
Expand All @@ -161,6 +168,7 @@ class Teraxion_TFNCommand_GetStartupByte(Teraxion_TFNCommand):
command_id = 0x35
num_received_bytes = 5


class Teraxion_TFNCommand_SetStartupByte(Teraxion_TFNCommand):
"""
Command to set the startup byte of the TFN.
Expand All @@ -169,6 +177,7 @@ class Teraxion_TFNCommand_SetStartupByte(Teraxion_TFNCommand):
command_id = 0x34
num_received_bytes = 5


class Teraxion_TFNCommand_GetFirmwareVersion(Teraxion_TFNCommand):
"""
Command to get the firmware version.
Expand All @@ -177,6 +186,7 @@ class Teraxion_TFNCommand_GetFirmwareVersion(Teraxion_TFNCommand):
command_id = 0x0F
num_received_bytes = 6


class Teraxion_TFNCommand_GetManufacturerName(Teraxion_TFNCommand):
"""
Command to get the manufacturer name.
Expand All @@ -185,6 +195,7 @@ class Teraxion_TFNCommand_GetManufacturerName(Teraxion_TFNCommand):
command_id = 0x0E
num_received_bytes = 255


class Teraxion_TFNCommand_GetModelNumber(Teraxion_TFNCommand):
"""
Command to get the model number.
Expand All @@ -193,6 +204,7 @@ class Teraxion_TFNCommand_GetModelNumber(Teraxion_TFNCommand):
command_id = 0x27
num_received_bytes = 255


class Teraxion_TFNCommand_GetSerialNumber(Teraxion_TFNCommand):
"""
Command to get the serial number.
Expand All @@ -201,6 +213,7 @@ class Teraxion_TFNCommand_GetSerialNumber(Teraxion_TFNCommand):
command_id = 0x29
num_received_bytes = 255


class Teraxion_TFNCommand_GetManufacturingDate(Teraxion_TFNCommand):
"""
Command to get the manufacturing date.
Expand All @@ -209,6 +222,7 @@ class Teraxion_TFNCommand_GetManufacturingDate(Teraxion_TFNCommand):
command_id = 0x2B
num_received_bytes = 255


class Teraxion_TFNCommand_GetNominalSettings(Teraxion_TFNCommand):
"""
Command to get the nominal settings.
Expand All @@ -217,6 +231,7 @@ class Teraxion_TFNCommand_GetNominalSettings(Teraxion_TFNCommand):
command_id = 0x37
num_received_bytes = 12


class Teraxion_TFNCommand_SaveNominalSettings(Teraxion_TFNCommand):
"""
Command to save the nominal settings.
Expand All @@ -225,6 +240,7 @@ class Teraxion_TFNCommand_SaveNominalSettings(Teraxion_TFNCommand):
command_id = 0x36
num_received_bytes = 12


class Teraxion_TFNCommand_GetChannelPlan(Teraxion_TFNCommand):
"""
Command to get the channel plan.
Expand All @@ -233,6 +249,7 @@ class Teraxion_TFNCommand_GetChannelPlan(Teraxion_TFNCommand):
command_id = 0x3B
num_received_bytes = 16


class Teraxion_TFNCommand_SetI2CAddress(Teraxion_TFNCommand):
"""
Command to get the channel plan.
Expand All @@ -254,12 +271,12 @@ class Teraxion_TFN(QMI_Instrument):

LEN_STATUS_BYTES = 4 # len of the status bytes.

READ_WRITE_DELAY = 0x000A # 10ms delay value between a write and read command in hex.
READ_WRITE_DELAY = 0x000A # 10ms delay value between write and read command in hex.

SOFTWARE_RESET_DELAY = 0.25 # delay after a software reset command in seconds.
GET_PROCESS_TIME = 0.01 # GET requests usually have a process time of 10ms
SET_PROCESS_TIME = 0.02 # SET requests usually have a process time of 20ms
GET_LONG_PROCESS_TIME = 0.05 # Long GET requests that return 255 bytes of data usually have a process time of 50ms.
GET_PROCESS_TIME = 0.01 # GET requests usually have a process time of 10ms
SET_PROCESS_TIME = 0.02 # SET requests usually have a process time of 20ms
GET_LONG_PROCESS_TIME = 0.05 # Long GET requests that return 255 bytes of data usually have a process time of 50ms.

def __init__(self, context: QMI_Context, name: str, transport: str) -> None:
super().__init__(context, name)
Expand Down Expand Up @@ -678,7 +695,7 @@ def set_i2c_address(self, address: int) -> None:
_logger.info("Setting I2C address of instrument [%s]", self._name)
self._check_is_open()
cmd = Teraxion_TFNCommand_SetI2CAddress
# shift module address by one and set the write bit
# shift module address by one and set write bit
write_mode = int(cmd.module_address) << 1
# make write command and send
wc = f"{self.CMD_START_CONDITION}{write_mode:02x}{cmd.command_id:02x}{address:04x}{self.CMD_STOP_CONDTION}"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def read(*names, **kwargs):
"wheel",
"twine",
# For static code checks
"astroid==2.12.2",
"astroid",
"coverage",
"pylint",
"pylint>=3.0",
"mypy",
],
"rtd": [
Expand Down
5 changes: 4 additions & 1 deletion tests/core/test_multiple_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,11 @@ def test_01_task_runs_normally(self):
"""Test that the task runs as expected."""
expected = [3.5e-07, 3.77e-07, 4.08e-07, 4.45e-07, 4.9e-07, 5.44e-07, 6.13e-07, 7e-07]
self.controller.start()
time.sleep(self.wait_timeout * 10) # Enough data should have been produced
for s in range(len(expected)):
# Wait that data is produced and check that we are still running.
while not self.receiver.has_signal_ready() and self.controller.is_running():
time.sleep(self.wait_timeout)

signal = self.receiver.get_next_signal(timeout=self.wait_timeout)
self.assertEqual(expected[s], round(signal.args[0], 9))

Expand Down

0 comments on commit 0821670

Please sign in to comment.