From d188d3405173e67dd50e5b1d5779801a8a75c52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Bron=C3=A8s?= <romain.brones@synchrotron-soleil.fr> Date: Wed, 27 Nov 2024 14:35:37 +0100 Subject: [PATCH] fix retreiving of read;write tuple * This is the new way the TTS returns read write values --- ArchiveExtractor/Core.py | 5 +++++ ArchiveExtractor/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ArchiveExtractor/Core.py b/ArchiveExtractor/Core.py index 2ac2d84..92f5bd0 100644 --- a/ArchiveExtractor/Core.py +++ b/ArchiveExtractor/Core.py @@ -103,6 +103,11 @@ def _extract_scalar(attribute, method, date1, date2, db, dtype): return None + # Detect if values contains a tuple read;write + if ';' in _value[0]: + logger.warning("Retrieved values are in read;write format. Keep only the read value") + _value = [_v.split(';')[0] for _v in _value] + # Transform to datetime - value arrays if dtype is bool: _value = aea._cast_bool(_value) diff --git a/ArchiveExtractor/__init__.py b/ArchiveExtractor/__init__.py index 1b498e1..9921028 100644 --- a/ArchiveExtractor/__init__.py +++ b/ArchiveExtractor/__init__.py @@ -18,7 +18,7 @@ Quick usage in ipython shell: """ # NB: Also change version number in setup.py -__version__ = "2.4.3" +__version__ = "2.4.4" __all__ = ["Access", ] diff --git a/setup.py b/setup.py index 4861c52..6d001a6 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='ArchiveExtractor', - version='2.4.3', # NB Also change version number in __init__.py + version='2.4.4', # NB Also change version number in __init__.py description='Python module for extracting data from Archive Extractor Tango Device.', url='https://gitlab.synchrotron-soleil.fr/dg/archiveextractor', license="GNU-GPL-v3", -- GitLab