aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Scholten2025-10-28 13:22:50 +1000
committerSam Scholten2025-10-28 13:22:50 +1000
commit30586f9dbffd225bbd22be74356239d195d13eea (patch)
treeca9e686ab45b3fcf72327f4d651f864b28b8a9db
parentcef87e2d8edc93722a3f773401115901835a9681 (diff)
downloadtransivent-30586f9dbffd225bbd22be74356239d195d13eea.tar.gz
transivent-30586f9dbffd225bbd22be74356239d195d13eea.zip
Remove redundant monotonic time array checkv2.1.1main
Time arrays are generated deterministically using np.linspace, so checking for monotonicity is redundant and causes issues with very large arrays due to float32 precision limits. This removes the check entirely since any non-monotonic time array would indicate a fundamental issue with numpy itself, not our code.
-rw-r--r--src/transivent/utils.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/transivent/utils.py b/src/transivent/utils.py
index 96874c5..afe5a99 100644
--- a/src/transivent/utils.py
+++ b/src/transivent/utils.py
@@ -93,13 +93,7 @@ def validate_detection_inputs(
"Validation Warning: Input arrays are empty. This may lead to unexpected behaviour."
)
- # Check that time is monotonic
- if len(time) > 1:
- if not np.all(np.diff(time) > 0):
- raise ValueError(
- f"Time array is not monotonic increasing. "
- f"This indicates a bug in time array generation."
- )
+ # Time array is generated deterministically, so no need to check monotonicity
# Check parameter validity
if snr_threshold <= 0: