From 84c0078d8bec0007dd883e140e8d09f1f378be5d Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Sat, 20 Jul 2024 18:23:06 -0400 Subject: added protection from unset maxRequiredPoints --- qolab/hardware/scope/_basic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qolab/hardware/scope/_basic.py b/qolab/hardware/scope/_basic.py index acb7687..bb655a0 100644 --- a/qolab/hardware/scope/_basic.py +++ b/qolab/hardware/scope/_basic.py @@ -15,9 +15,9 @@ def calcSparsingAndNumPoints(availableNpnts=None, maxRequiredPoints=None): Parameters ---------- - availableNpnts: int or None + availableNpnts: int or None (throws error) Number of available points. If set to None exit with error - maxRequiredPoints: int or (None) + maxRequiredPoints: int or None (throws error) number of requested points after decimation. If availableNpnts< maxRequiredPoints*2, decimation is impossible and we will get up to factor of 2 more @@ -30,7 +30,7 @@ def calcSparsingAndNumPoints(availableNpnts=None, maxRequiredPoints=None): if availableNpnts is None: raise ValueError("Invalid availableNpnts value, must be int.") if maxRequiredPoints is None: - maxRequiredPoints = self.maxRequiredPoints + raise ValueError("Invalid maxRequiredPoints value, must be int.") if availableNpnts <= maxRequiredPoints * 2: Npnts = availableNpnts -- cgit v1.2.3