Skip to content

fix(preprocess): reject degenerate delay axis in load_and_clean - #33

Open
IG-ABHINAV wants to merge 1 commit into
LupoLab:mainfrom
IG-ABHINAV:fix/preprocess-reject-degenerate-delay-axis-32
Open

IG-ABHINAV wants to merge 1 commit into
LupoLab:mainfrom
IG-ABHINAV:fix/preprocess-reject-degenerate-delay-axis-32

Conversation

@IG-ABHINAV

Copy link
Copy Markdown

Closes #32. load_and_clean accepted a one-delay trace, then failed later with an unrelated error (ZeroDivisionError in Grid.__init__, or a finufft segfault) because _delay_filter takes the mean of an empty diff. Added _validate_delay_axis in croak/preprocess.py, called in both load_and_clean and filter_frog_trace: it raises ValueError("the delay axis needs at least two distinct finite values ...") for fewer than two distinct finite delays. Added 2 regression tests and a changelog.d fragment.

Tests: ruff check and ruff format --check clean on both changed files; validator logic run standalone with numpy — all 4 degenerate cases raise the exact ValueError, valid axes pass through.

Note: the repo test suite was not runnable locally (requires Python >= 3.14; this sandbox has 3.12) — please let CI run the full gate before merging.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 croak | 🛠️ Build #35887617 | 📁 Comparing 1f52204 against latest (73c72ba)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

load_and_clean accepts a single delay and fails later (ZeroDivisionError or a finufft segfault)

1 participant