From 30586f9dbffd225bbd22be74356239d195d13eea Mon Sep 17 00:00:00 2001 From: Sam Scholten Date: Tue, 28 Oct 2025 13:22:50 +1000 Subject: Remove redundant monotonic time array check 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. --- src/transivent/utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') 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: -- cgit v1.2.3