refactor(pyargus): update python bindings for breaking changes

This commit is contained in:
Anand Balakrishnan 2023-08-30 12:49:14 -07:00
parent 0e38c2fecf
commit b8c67bcea9
No known key found for this signature in database
5 changed files with 94 additions and 41 deletions

View file

@ -1,15 +1,22 @@
use std::time::Duration;
use argus_core::signals::{InterpolationMethod, Signal};
use argus_core::signals::Signal;
use pyo3::prelude::*;
use crate::{DType, PyArgusError};
#[pyclass(name = "InterpolationMethod", module = "argus")]
#[derive(Debug, Clone, Copy, Default)]
pub enum PyInterp {
#[default]
Linear,
}
#[pyclass(name = "Signal", subclass, module = "argus")]
#[derive(Debug, Clone)]
pub struct PySignal {
pub kind: DType,
pub interpolation: InterpolationMethod,
pub interpolation: PyInterp,
}
macro_rules! impl_signals {
@ -23,7 +30,7 @@ macro_rules! impl_signals {
#[inline]
pub fn super_type() -> PySignal {
PySignal {
interpolation: InterpolationMethod::Linear,
interpolation: PyInterp::Linear,
kind: DType::$ty_name,
}
}