Package: nqm.irimager
nqm.irimagerPython module for interfacing withEvoCortex IRImagerDirect SDK.SetupInstallinglibirimagernqm.irimagerrequires theEvoCortex IRImagerDirect SDK(known aslibirimager). Please follow the instructions on their webpage to
install the package.You will also need toDownload calibration data usingsudo ir_download_calibration, seehttp://documentation.evocortex.com/libirimager2/html/Installation.html#subsec_downloadCreate an XML configuration file usingir_generate_configuration, seehttp://documentation.evocortex.com/libirimager2/html/Installation.html#subsec_configIt's possible to install a mocked version ofnqm.irimagerfor testing
by definingSKBUILD_CMAKE_DEFINE='IRImager_mock=ON'whiling buildingnqm.irimager.Installnqm.irimagerThis repo usesPEP621to manage
dependencies.scikit-build-coreis used to compile the project as abuild-system.build-backend.We recommend usingPDMfor local development.pdminstallUsage exampleSee documentation for the full API reference, but using this library is as
easy as:importdatetimeimportloggingfromnqm.irimagerimportIRImager,Loggerlogging.basicConfig()logging.getLogger().setLevel(1)# tracelogger=Logger()# Your XML config,# see http://documentation.evocortex.com/libirimager2/html/Overview.html#subsec_overview_config_fileXML_CONFIG="tests/__fixtures__/382x288@27Hz.xml"irimager=IRImager(XML_CONFIG)withirimager:print(f"Started at{datetime.datetime.now()}")whileTrue:# press CTRL+C to stop this programtry:array,timestamp=irimager.get_frame()excepterror:print(f"Stopped at{datetime.datetime.now()}")raiseerrorframe_in_celsius=array/(10**irimager.get_temp_range_decimal())-100print(f"At{timestamp}: Average temperature is{frame_in_celsius.mean()}")dellogger# to stopDevelopmentPre-commit checks (linting and type checks)This project usespre-committo check code.
You may wish to runpdm run pre-commit installto automatically run
checks before you rungit commit.Additionally, you can runpdm run pre-commit run --allto check all changes.TestsTests are written usingpytest, and can be run with:pdmrunpytestC++ unit testsSome C++ tests are written usingGoogleTestandgMock.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"pdminstall&&pdmrunpytestIf you want to use bothBUILD_TESTING=ONandIRImager_mock=ON, you can do the following:SKBUILD_CMAKE_DEFINE='BUILD_TESTING=ON;IRImager_mock=ON'pdminstall&&pdmrunpytestMypy stubtestYou can useMypy'sstubtesttoolto 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 thenqm.irimagermodule.NoteTheerror: nqm.irimager.IRImager is inconsistent, metaclass differserrors
are expected, due to the inability to stub built-in pybind11 types.me@user:~$MYPYPATH=src.venv/bin/stubtestnqm.irimager
error:nqm.irimager.IRImagerisinconsistent,metaclassdiffers
Stub:infilesrc/nqm/irimager/__init__.pyi:11
N/A
Runtime:
<class'pybind11_builtins.pybind11_type'>

Found1error(checked1module)DocumentationSphinxis used to generate
documentation in thedocs/directory.sphinx.ext.napoleonautomatically parses Google-style Python docstrings.pdmrunsphinx-build-Mhtmldocs/build/