diff --git a/src/_py/mod.rs b/src/_py/mod.rs index 7da3188..4b37399 100644 --- a/src/_py/mod.rs +++ b/src/_py/mod.rs @@ -1,4 +1,3 @@ - /// Python wrapper for [`crate::utils::qdf`]. pub mod qdf; diff --git a/src/_py/panel.rs b/src/_py/panel.rs index 1e0ebfe..a332677 100644 --- a/src/_py/panel.rs +++ b/src/_py/panel.rs @@ -1,11 +1,13 @@ use pyo3::prelude::*; -use pyo3_polars::PyDataFrame; +use pyo3_polars::{PyDataFrame, PySeries}; /// Python wrapper for [`crate::panel`] module. #[allow(deprecated)] #[pymodule] pub fn panel(_py: Python, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(historic_vol, m)?)?; + m.add_function(wrap_pyfunction!(get_bdates_from_col_hv, m)?)?; + m.add_function(wrap_pyfunction!(get_period_indices_hv, m)?)?; Ok(()) } @@ -44,3 +46,18 @@ pub fn historic_vol( .unwrap(), )) } + +#[pyfunction] +pub fn get_bdates_from_col_hv(dfw: PyDataFrame, est_freq: &str) -> PyResult { + Ok(PySeries( + crate::panel::historic_vol::get_bdates_from_col_hv(&dfw.into(), est_freq) + .unwrap() + .into(), + )) +} + + +#[pyfunction] +pub fn get_period_indices_hv(dfw: PyDataFrame, est_freq: &str) -> PyResult> { + Ok(crate::panel::historic_vol::get_period_indices_hv(&dfw.into(), est_freq).unwrap()) +}