diff options
| author | Sam Scholten | 2025-10-28 13:26:16 +1000 |
|---|---|---|
| committer | Sam Scholten | 2025-10-28 13:27:08 +1000 |
| commit | 2c382a14d963b18708ae1c9a0756b0c17d66e01a (patch) | |
| tree | 8d0e8125457920fee9685f8705b4a0ec3c69ea5e | |
| parent | b13198edb3120826c006aeca1414e109cec66ec2 (diff) | |
| download | scopekit-2c382a14d963b18708ae1c9a0756b0c17d66e01a.tar.gz scopekit-2c382a14d963b18708ae1c9a0756b0c17d66e01a.zip | |
remove monotonicity checkv1.0.2
| -rw-r--r-- | pyproject.toml | 2 | ||||
| -rw-r--r-- | src/scopekit/data_manager.py | 84 |
2 files changed, 43 insertions, 43 deletions
diff --git a/pyproject.toml b/pyproject.toml index 888af00..e0b5d54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scopekit" -version = "1.0.1" +version = "1.0.2" description = "General-purpose oscilloscope plotting components." authors = [{ name = "Sam Scholten", email = "s.scholten@uq.edu.au" }] requires-python = ">=3.8" diff --git a/src/scopekit/data_manager.py b/src/scopekit/data_manager.py index 2f13ce3..8d337ad 100644 --- a/src/scopekit/data_manager.py +++ b/src/scopekit/data_manager.py @@ -206,20 +206,20 @@ class TimeSeriesDataManager: warnings.warn(f"Initialising trace {trace_idx} with empty arrays.", UserWarning) return - # Check time array is monotonic - if len(t) > 1: - # Use a small epsilon for floating-point comparison - tolerance = 1e-9 - if not np.all(np.diff(t) > tolerance): - problematic_diffs = np.diff(t)[np.diff(t) <= tolerance] - warnings.warn( - f"Time array for trace {trace_idx} is not strictly monotonic increasing within tolerance {tolerance}. " - f"Problematic diffs (first 10): {problematic_diffs[:10]}. " - f"This may affect analysis results.", UserWarning - ) + # # Check time array is monotonic + # if len(t) > 1: + # # Use a small epsilon for floating-point comparison + # tolerance = 1e-9 + # if not np.all(np.diff(t) > tolerance): + # problematic_diffs = np.diff(t)[np.diff(t) <= tolerance] + # warnings.warn( + # f"Time array for trace {trace_idx} is not strictly monotonic increasing within tolerance {tolerance}. " + # f"Problematic diffs (first 10): {problematic_diffs[:10]}. " + # f"This may affect analysis results.", UserWarning + # ) # Check for non-uniform sampling - self._check_uniform_sampling(t, trace_idx) + # self._check_uniform_sampling(t, trace_idx) @property def overlay_lines(self) -> List[Dict[str, Any]]: @@ -394,33 +394,33 @@ class TimeSeriesDataManager: return t_masked, x_masked - def _check_uniform_sampling(self, t: np.ndarray, trace_idx: int = 0) -> None: - """ - Check if time array is uniformly sampled and issue warnings if not. - - Parameters - ---------- - t : np.ndarray - Time array to check. - trace_idx : int, default=0 - Index of the trace being checked (for warning messages). - """ - if len(t) < 3: - return # Not enough points to check uniformity - - # Calculate time differences - dt = np.diff(t) - - # Calculate statistics - dt_mean = np.mean(dt) - dt_std = np.std(dt) - dt_cv = dt_std / dt_mean if dt_mean > 1e-15 else 0 # Coefficient of variation - - # Check for significant non-uniformity - # CV > 0.1 (10%) indicates potentially problematic non-uniformity - if dt_cv > 0.1: - warnings.warn( - f"Severe non-uniform sampling detected in trace {trace_idx}: " - f"mean dt={dt_mean:.3e}s, std={dt_std:.3e}s, CV={dt_cv:.2%}. " - f"May affect analysis results.", UserWarning - ) +# def _check_uniform_sampling(self, t: np.ndarray, trace_idx: int = 0) -> None: +# """ +# Check if time array is uniformly sampled and issue warnings if not. +# +# Parameters +# ---------- +# t : np.ndarray +# Time array to check. +# trace_idx : int, default=0 +# Index of the trace being checked (for warning messages). +# """ +# if len(t) < 3: +# return # Not enough points to check uniformity +# +# # Calculate time differences +# dt = np.diff(t) +# +# # Calculate statistics +# dt_mean = np.mean(dt) +# dt_std = np.std(dt) +# dt_cv = dt_std / dt_mean if dt_mean > 1e-15 else 0 # Coefficient of variation +# +# # Check for significant non-uniformity +# # CV > 0.1 (10%) indicates potentially problematic non-uniformity +# if dt_cv > 0.1: +# warnings.warn( +# f"Severe non-uniform sampling detected in trace {trace_idx}: " +# f"mean dt={dt_mean:.3e}s, std={dt_std:.3e}s, CV={dt_cv:.2%}. " +# f"May affect analysis results.", UserWarning +# ) |
