From 1343a5f6886767986d8b0fa75d87d34ffb7f8fed Mon Sep 17 00:00:00 2001 From: Alexey Shkarin Date: Tue, 4 Oct 2022 22:56:18 +0200 Subject: [PATCH] Minor tests and docs bugfixes --- docs/devices/Cryocon.rst | 2 +- pylablib/core/dataproc/table_wrap.py | 2 +- tests/devices/test_cameras.py | 31 +++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/docs/devices/Cryocon.rst b/docs/devices/Cryocon.rst index 41ae6c3..40e6a3c 100644 --- a/docs/devices/Cryocon.rst +++ b/docs/devices/Cryocon.rst @@ -6,7 +6,7 @@ CryoCon temperature sensors ============================== -CryoCon manufactures a range of temperature sensor controllers and resistance bridges, which are also used for temperature sensing. There is some overlap between different products, but they still use fairly distinct interfaces and interaction patterns. The code has been tested with CryoCon 14C temperature controller. +CryoCon manufactures a range of temperature sensor controllers and resistance bridges, which are also used for temperature sensing. The code has been tested with CryoCon 14C temperature controller. The main device class is :class:`pylablib.devices.Cryocon.Cryocon1x<.Cryocon.base.Cryocon1x>`. diff --git a/pylablib/core/dataproc/table_wrap.py b/pylablib/core/dataproc/table_wrap.py index cee579f..e439161 100644 --- a/pylablib/core/dataproc/table_wrap.py +++ b/pylablib/core/dataproc/table_wrap.py @@ -611,7 +611,7 @@ def __init__(self, wrapper, storage): self._wrapper=wrapper self._storage=storage def __iter__(self): - for _,c in self._storage.iteritems(): + for _,c in self._storage.items(): yield c def __getitem__(self, idx): return self._storage.iloc[:,idx] diff --git a/tests/devices/test_cameras.py b/tests/devices/test_cameras.py index ddde357..05173d7 100644 --- a/tests/devices/test_cameras.py +++ b/tests/devices/test_cameras.py @@ -9,6 +9,7 @@ from pylablib.devices import Thorlabs from pylablib.devices import Photometrics from pylablib.devices import PrincetonInstruments +from pylablib.devices import Basler from .test_basic_camera import ROICameraTester @@ -150,6 +151,24 @@ def test_large_acq(self, devopener): +class TestPhotonFocusBitFlow(ROICameraTester): + """Testing class for PhotonFocus camera with BitFlow interface""" + devname="photon_focus_bitflow" + devcls=PhotonFocus.PhotonFocusBitFlowCamera + rois=gen_rois(128) + + def check_status_line(self, frames): + slines=PhotonFocus.get_status_lines(np.asarray(frames)) + assert slines is not None + assert np.all(slines[1:,0]-slines[:-1,0]==1) + + @pytest.fixture(scope="class") + def library_parameters(self): + pylablib.par["devices/dlls/pfcam"]="../dlls/libs/x32" + + + + class TestIMAQdx(ROICameraTester): """Testing class for IMAQdx camera interface""" devname="imaqdx" @@ -217,4 +236,14 @@ class TestPICam(ROICameraTester): _exposure_precision=1E-4 @classmethod def post_open(cls, device): - device.enable_metadata(True) \ No newline at end of file + device.enable_metadata(True) + + + + + +class TestBasler(ROICameraTester): + """Testing class for Basler pylon camera interface""" + devname="basler_pylon" + devcls=Basler.BaslerPylonCamera + rois=gen_rois(64) \ No newline at end of file