Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
378daa2
Add kaiser_atten
SpookyYomo Oct 16, 2024
d2c78ec
Add kaiser_beta
SpookyYomo Oct 17, 2024
7fdef5c
Add kaiserord
SpookyYomo Oct 18, 2024
0025daf
Add signal::windows namespace and helper functions
SpookyYomo Oct 22, 2024
1a2feb6
Add Boxcar window type
SpookyYomo Oct 23, 2024
e860413
Add triangle window
SpookyYomo Oct 25, 2024
87384f4
Add general cosine window
SpookyYomo Nov 19, 2024
b3b4ff9
Add Blackman window
SpookyYomo Nov 22, 2024
e5033da
Add more documentation to signal module
SpookyYomo Nov 23, 2024
35aad91
Add general gaussian window
SpookyYomo Nov 24, 2024
575e428
Add General Hamming
SpookyYomo Nov 25, 2024
a052c20
Add Hamming window
SpookyYomo Nov 26, 2024
4696efc
Add kaiser window
SpookyYomo Nov 28, 2024
fe309d3
Add library level errors
SpookyYomo Nov 29, 2024
ca2a064
Add Nuttall window
SpookyYomo Dec 3, 2024
cd9b27d
Add convenience GetWindow impl for Window variants
SpookyYomo Dec 4, 2024
df21ea3
Add scipy.signal.windows.get_window function
SpookyYomo Dec 4, 2024
fe8c79a
Add firwin
SpookyYomo Dec 6, 2024
bff6c9d
Fix lack of use of num_traits::identities
SpookyYomo Dec 9, 2024
6a456de
Fix clippy errors in Triangle
SpookyYomo Jul 15, 2025
7760754
fix: Add zero numtap check in Firwin validation
SpookyYomo Sep 23, 2025
09c93a4
docs: Add macro use in Triangle
SpookyYomo Sep 25, 2025
ab8e89f
test: Add get_window macro test in Triangle
SpookyYomo Sep 25, 2025
c300bc8
Fix improper error message from window/width both being some
SpookyYomo Nov 17, 2025
50b02ee
feat: Add get_window macro
SpookyYomo Sep 24, 2025
1615277
Hack macro-scoping into crate::signal for `get_window`
SpookyYomo Dec 2, 2025
94a951f
Remove need to import GetWindow trait for users of `get_window`
SpookyYomo Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions sci-rs/src/error/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use core::{error, fmt};

/// Errors raised whilst running sci-rs.
#[derive(Debug, PartialEq, Eq)]
#[cfg(feature = "alloc")]
pub enum Error {
/// Argument parsed into function were invalid.
InvalidArg {
/// The invalid arg
arg: alloc::string::String,
/// Explaining why arg is invalid.
reason: alloc::string::String,
},
/// Two or more optional arguments passed into functions conflict.
ConflictArg {
/// Explaining what arg is invalid.
reason: alloc::string::String,
},
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
todo!()
}
Copy link

Choose a reason for hiding this comment

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

Error Display implementation panics with todo!()

The Display trait implementation for Error contains a todo!() macro that will panic at runtime if the error is ever formatted. This occurs when using the {} format specifier, calling .to_string(), or using the ? operator in functions returning String errors. Since firwin_dyn and other functions return Result<_, Error>, any code that attempts to display these errors will crash.

Fix in Cursor Fix in Web

}

impl error::Error for Error {}
3 changes: 3 additions & 0 deletions sci-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ pub mod special;
/// Debug plotting
#[cfg(feature = "plot")]
pub mod plot;

/// Errors
pub mod error;
Loading
Loading