Skip to main content

nqm.irimager

Code style: black Linting: Pylint Imports: isort Managed by PDM

Python module for interfacing with EvoCortex IRImagerDirect SDK.

Setup

Installing libirimager

nqm.irimager requires the EvoCortex IRImagerDirect SDK (known as libirimager). Please follow the instructions on their webpage to install the package.

You will also need to

It's possible to install a mocked version of nqm.irimager for testing by defining SKBUILD_CMAKE_DEFINE='IRImager_mock=ON' whiling building nqm.irimager.

Install nqm.irimager

This repo uses PEP621 to manage dependencies. scikit-build-core is used to compile the project as a build-system.build-backend.

We recommend using PDM for local development.

pdm install

Usage example

See documentation for the full API reference, but using this library is as easy as:

import datetime
import logging
from nqm.irimager import IRImager, Logger

logging.basicConfig()
logging.getLogger().setLevel(1) # trace
logger = Logger()
# Your XML config,
# see http://documentation.evocortex.com/libirimager2/html/Overview.html#subsec_overview_config_file
XML_CONFIG = "tests/__fixtures__/382x288@27Hz.xml"
irimager = IRImager(XML_CONFIG)
with irimager:
    print(f"Started at {datetime.datetime.now()}")
    while True: # press CTRL+C to stop this program
        try:
          array, timestamp = irimager.get_frame()
        except error:
          print(f"Stopped at {datetime.datetime.now()}")
          raise error
        frame_in_celsius = array / (10 ** irimager.get_temp_range_decimal()) - 100
        print(f"At {timestamp}: Average temperature is {frame_in_celsius.mean()}")

del logger # to stop

Development

Pre-commit checks (linting and type checks)

This project uses pre-commit to check code. You may wish to run pdm run pre-commit install to automatically run checks before you run git commit.

Additionally, you can run pdm run pre-commit run --all to check all changes.

Tests

Tests are written using pytest, and can be run with:

pdm run pytest

C++ unit tests

Some C++ tests are written using GoogleTest and gMock.

As these tests need the [Development.Embed][FindPython3] Python3 embedding artifact (which aren't available on most systems), you must opt-in to building and running these tests by using:

SKBUILD_CMAKE_DEFINE="BUILD_TESTING=ON" pdm install && pdm run pytest

If you want to use both BUILD_TESTING=ON and IRImager_mock=ON, you can do the following:

SKBUILD_CMAKE_DEFINE='BUILD_TESTING=ON;IRImager_mock=ON' pdm install && pdm run pytest

Mypy stubtest

You can use Mypy's stubtest tool to automatically check whether the types in a stub file match the implementation.

For most Python code, we put the type information directly in the implementation, so we only need this for C/C++ Python extensions, like the nqm.irimager module.

Note

The error: nqm.irimager.IRImager is inconsistent, metaclass differs errors are expected, due to the inability to stub built-in pybind11 types.

me@user:~$ MYPYPATH=src .venv/bin/stubtest nqm.irimager
error: nqm.irimager.IRImager is inconsistent, metaclass differs
Stub: in file src/nqm/irimager/__init__.pyi:11
N/A
Runtime:
<class 'pybind11_builtins.pybind11_type'>

Found 1 error (checked 1 module)

Documentation

Sphinx is used to generate documentation in the docs/ directory.

sphinx.ext.napoleon automatically parses Google-style Python docstrings.

pdm run sphinx-build -M html docs/ build/

Metadata

Release files for nqm.irimager 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nqm.irimager 1.0.0
File Size Uploaded
nqm_irimager-1.0.0.tar.gz 67.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for nqm.irimager 1.0.0
File
nqm_irimager-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
nqm_irimager-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64 Details
nqm_irimager-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
nqm_irimager-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64 Details
nqm_irimager-1.0.0-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details
nqm_irimager-1.0.0-cp39-cp39-manylinux_2_28_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ ARM64 Details
nqm_irimager-1.0.0-cp38-cp38-manylinux_2_28_aarch64.whl CPython 3.8 CPython 3.8 Linux glibc 2.28+ ARM64 Details

Total release size: 12.3 MB

Release files / nqm_irimager-1.0.0.tar.gz

Download URL nqm_irimager-1.0.0.tar.gz
Size 67.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b467fa50e90844643dca9d36cbdda34ecd429cad6640ee0b1230b8ea23ff4f48
BLAKE2b-256 checksum
How to use checksums
f8c9b17494f37e420fda25105497c6ae0086974f899f67e4e8ec60ea61b22543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nqm_irimager-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL nqm_irimager-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4f581c62f4a4a009bd1fc1af31e545195c04db041120c4ccdda2785781b068e9
BLAKE2b-256 checksum
How to use checksums
00419468e3de265469f7b9e2b2c1a13e62df36f9c6d08bee22f7881e8a7f1a36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nqm_irimager-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl

Download URL nqm_irimager-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl
Size 1.7 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
fc2201341b2a02abb58eff16dc1a90fa73830de1ab5468f19f634b18053cf406
BLAKE2b-256 checksum
How to use checksums
88db8e75013afc558c0e0cdd520c64825769689d5b1454d1feff0f62de332c93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nqm_irimager-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL nqm_irimager-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3db86050101001f2fc04a5c6df46fe8af462f84662ebd5dbac4b389048413507
BLAKE2b-256 checksum
How to use checksums
9f4f3db3266dccc16bb71b06c323ff92ee24448125cc14fee1ca203c989316ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nqm_irimager-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl

Download URL nqm_irimager-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl
Size 1.7 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
56c799d349297307286e4a8e9546ad2923d2cea27ae4ea9dced1d5f38c62d91d
BLAKE2b-256 checksum
How to use checksums
502f6d5273e61bdb235b033ef159172f33d5a6660193a0adf3b7232f4da0b0e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nqm_irimager-1.0.0-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL nqm_irimager-1.0.0-cp39-cp39-manylinux_2_28_x86_64.whl
Size 1.8 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
06897b9d620b17cf6fe726af43d89b536ef5eedcb3be48b360d9d361b5440af9
BLAKE2b-256 checksum
How to use checksums
b763fa3375b90ad8fbc63f12d28e96f3b954811ed96f345fcc9391a2b90094e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nqm_irimager-1.0.0-cp39-cp39-manylinux_2_28_aarch64.whl

Download URL nqm_irimager-1.0.0-cp39-cp39-manylinux_2_28_aarch64.whl
Size 1.7 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
8698c3331938d064982e03372a462c052ca713c0aeb8063f675e71388cdf348c
BLAKE2b-256 checksum
How to use checksums
b611985d10ea73840a377c75d84ccc311ee20c8c5d4f7fe5fce9e35c779d66df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / nqm_irimager-1.0.0-cp38-cp38-manylinux_2_28_aarch64.whl

Download URL nqm_irimager-1.0.0-cp38-cp38-manylinux_2_28_aarch64.whl
Size 1.7 MB
Tags CPython 3.8 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
a5c432b1bfc7754b0780b86dad09d673373b9e2a1840c08f3991df39d96385a6
BLAKE2b-256 checksum
How to use checksums
413a862fe287435dad42c3f0f144755b7766ae8150eaaff9e3b56ab31cbd1883
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

1.0.0 This release

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page