Skip to content

Feat/nan policy signal processing 303 - #338

Merged
kmolan merged 5 commits into
kmolan:mainfrom
solus161:feat/nan_policy_signal_processing_303
Sep 3, 2026
Merged

Feat/nan policy signal processing 303#338
kmolan merged 5 commits into
kmolan:mainfrom
solus161:feat/nan_policy_signal_processing_303

Conversation

@solus161

Copy link
Copy Markdown
Contributor

What & why

Signal filters never panic on non-finite input (NAN or INFINITY) but returned value could be meaningless and filters' states could be corrupted, at worst, till filters' reset.

What's new:

Checklist

  • cargo test + cargo clippy --all-targets clean locally
  • New public APIs have a doc example
  • No unwrap/expect/panic on library paths (typed errors instead)

Current entries are not touched. Additional entries check for
non-finite, or non-nan values, and reject one that could spoil/corrupt
filters' states.
…l_processing_303

# Conflicts:
#	crates/multicalc/tutorials/signal-processing.md
@solus161
solus161 requested a review from kmolan as a code owner August 25, 2026 12:49
//! timestep in seconds, and takes frequencies in hertz. A filter is configured once, with the
//! configuration checked up front, and every call after that is total.
//! configuration checked up front, and every call after that is infallible: it never panics, never
//! allocates, and never returns an error.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduce the walls of text everywhere in this PR to be minimal. They are noise and distract from actual code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trimmed away a few hundred lines. Most added codes, apart from tests ~ 50% of added lines, are now doctests, and actual codes account for ~ 1/3 of the src/signal_processing.rs. The actual codes are just checked entry points for core filter methods. They are not technically difficult to implement. But it is the behavior of filters when fed NAN or INFINITY or both worth noting as these could vary filter by filter. Furthermore, as the state of signal_processing kinda doc-heavy, do you want to further reduce the content of these doctests?

P/S: the CI failed to run due to a test numerical_derivative::proptest_ad_fd_single_first stdout. It is not from this PR. So I'll wait for your instruction.

@kmolan
kmolan merged commit d580054 into kmolan:main Sep 3, 2026
17 checks passed
@solus161
solus161 deleted the feat/nan_policy_signal_processing_303 branch September 4, 2026 03:52
Thiago316316 added a commit to Thiago316316/multicalc-rust that referenced this pull request Sep 5, 2026
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.

2 participants