diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/scopekit/decimation.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/scopekit/decimation.py b/src/scopekit/decimation.py index 107054d..a8add3b 100644 --- a/src/scopekit/decimation.py +++ b/src/scopekit/decimation.py @@ -555,10 +555,11 @@ class DecimationManager: # Find indices for current view in raw time mask = (t_raw_full >= xlim_raw[0]) & (t_raw_full <= xlim_raw[1]) - if not np.any(mask): - warnings.warn( - f"No data in view for xlim_raw: {xlim_raw}. Returning empty arrays.", RuntimeWarning - ) + t_view = t_raw_full[mask] + x_view = x_raw_full[mask] + + # If no data in view, return empty arrays (normal during zooming) + if len(t_view) == 0: empty_result = ( np.array([], dtype=np.float32), np.array([], dtype=np.float32), @@ -570,9 +571,6 @@ class DecimationManager: self._cache[cache_key] = empty_result return empty_result - t_view = t_raw_full[mask] - x_view = x_raw_full[mask] - # Add warning for large number of points in detail mode if not use_envelope and len(t_view) > self.DETAIL_MODE_POINT_WARNING_THRESHOLD: warnings.warn( |
