From 70b25e34640f1e30bb95b4a7a7b1d88d5aa6b0b1 Mon Sep 17 00:00:00 2001 From: Valentin Valls Date: Wed, 19 May 2021 18:36:45 +0200 Subject: [PATCH] Add warning in case of inconsistency --- bliss/scanning/scan_info.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bliss/scanning/scan_info.py b/bliss/scanning/scan_info.py index 86e8bd6ad9..a972cd7e9c 100644 --- a/bliss/scanning/scan_info.py +++ b/bliss/scanning/scan_info.py @@ -152,6 +152,10 @@ API import typing import typeguard import numbers +import logging + + +_logger = logging.getLogger(__name__) class ScanInfo(dict): @@ -257,6 +261,17 @@ class ScanInfo(dict): if axis_points_hint is not None: meta["axis-points-hint"] = axis_points_hint + if axis_kind is not None: + # If a kind is set the orientation of the scan have to be known + if start is None: + _logger.warning( + "A 'start' position for the channel '%s' should be set", name + ) + if stop is None: + _logger.warning( + "A 'stop' position for the channel '%s' should be set", name + ) + @typeguard.typechecked def add_scatter_plot( self, -- GitLab