Removed some warnings. Updated to new pyo3 api 0.22
This commit is contained in:
parent
c7d2cfc43f
commit
0338807507
@ -96,6 +96,7 @@ default = ["f64", "cpal-api", "record"]
|
||||
# Use this for debugging extensions
|
||||
# default = ["f64", "python-bindings", "record", "cpal-api"]
|
||||
|
||||
pulse-api = []
|
||||
cpal-api = ["dep:cpal"]
|
||||
record = ["dep:hdf5-sys", "dep:hdf5", "dep:chrono", "dep:uuid"]
|
||||
f64 = []
|
||||
|
@ -32,7 +32,7 @@ pub trait Stream {
|
||||
}
|
||||
|
||||
/// Stream API descriptor: type and corresponding text
|
||||
#[cfg_attr(feature = "python-bindings", pyclass)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass(eq, eq_int))]
|
||||
#[derive(strum_macros::EnumMessage, Debug, Clone, PartialEq, Serialize, Deserialize, strum_macros::Display)]
|
||||
#[allow(dead_code)]
|
||||
pub enum StreamApiDescr {
|
||||
|
@ -8,7 +8,7 @@ use crate::config::*;
|
||||
/// Data type description for samples coming from a stream
|
||||
#[derive(strum_macros::EnumMessage, PartialEq, Copy, Debug, Clone, Serialize, Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass(eq, eq_int))]
|
||||
pub enum DataType {
|
||||
/// 32-bit floats
|
||||
#[strum(message = "F32", detailed_message = "32-bits floating points")]
|
||||
|
@ -50,7 +50,7 @@ use api::*;
|
||||
use crate::config::*;
|
||||
/// Stream types that can be started
|
||||
///
|
||||
#[cfg_attr(feature = "python-bindings", pyclass)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass(eq, eq_int))]
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
pub enum StreamType {
|
||||
/// Input-only stream
|
||||
|
@ -8,7 +8,7 @@ use serde::{Serialize, Deserialize};
|
||||
|
||||
/// Physical quantities that are I/O of a Daq device.
|
||||
#[derive(PartialEq, Serialize, Deserialize, strum_macros::EnumMessage, Debug, Clone, Copy)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass(eq, eq_int))]
|
||||
#[allow(dead_code)]
|
||||
pub enum Qty {
|
||||
/// Number
|
||||
|
@ -2,8 +2,8 @@ use strum_macros::Display;
|
||||
use crate::config::*;
|
||||
|
||||
/// Errors that happen in a stream
|
||||
#[derive(strum_macros::EnumMessage, Debug, Clone, Display, Copy)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass)]
|
||||
#[derive(strum_macros::EnumMessage, PartialEq, Debug, Clone, Display, Copy)]
|
||||
#[cfg_attr(feature = "python-bindings", pyclass(eq, eq_int))]
|
||||
pub enum StreamError {
|
||||
/// Input overrun
|
||||
#[strum(
|
||||
|
@ -97,7 +97,7 @@ impl SeriesBiquad {
|
||||
let filter_coefs = &[1., 0., 0., 1., 0., 0.];
|
||||
SeriesBiquad::new(filter_coefs).unwrap()
|
||||
}
|
||||
// pub fn fromZpk(ZerosOrPoles)
|
||||
|
||||
fn clone_dyn(&self) -> Box<dyn Filter> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
@ -587,12 +587,12 @@ mod test {
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_apssettings1() {
|
||||
let s = ApsSettingsBuilder::default().build().unwrap();
|
||||
let _ = ApsSettingsBuilder::default().build().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_apssettings2() {
|
||||
let s = ApsSettingsBuilder::default()
|
||||
let _ = ApsSettingsBuilder::default()
|
||||
.nfft(2048)
|
||||
.fs(1.0)
|
||||
.build()
|
||||
|
@ -171,7 +171,7 @@ mod test {
|
||||
let tres = tb.pop(10, 5).unwrap();
|
||||
assert_eq!(tres.shape(), [10, 1]);
|
||||
assert_eq!(tb.nsamples(), 15);
|
||||
let tres = tb.pop(10, 0).unwrap();
|
||||
let _ = tb.pop(10, 0).unwrap();
|
||||
assert_eq!(tb.nsamples(), 5);
|
||||
let tres = tb.pop(5, 5).unwrap();
|
||||
assert_eq!(tres.shape(), [5, 1]);
|
||||
|
Loading…
Reference in New Issue
Block a user