moving stuff around

This commit is contained in:
Palash Tyagi
2024-11-22 23:39:56 +00:00
parent f9ccad855f
commit 26a220cc4c
7 changed files with 541 additions and 85 deletions

View File

@@ -1,16 +1,16 @@
/// Python API for [`crate::utils::qdf`].
/// Python wrapper for [`crate::utils::qdf`].
pub mod qdf;
/// Python API for [`crate::download`].
/// Python wrapper for [`crate::download`].
pub mod download;
/// Python API for [`crate::panel`].
/// Python wrapper for [`crate::panel`].
pub mod panel;
use pyo3::{prelude::*, wrap_pymodule};
// use pyo3_polars::PyDataFrame;
/// PyO3 bindings for the `msyrs` Python wrapper.
#[allow(deprecated)]
#[pymodule]
pub fn msyrs(_py: Python, m: &PyModule) -> PyResult<()> {

View File

@@ -16,7 +16,7 @@
//!
/// Documentation and type-stubs for the `msyrs` Python API.
pub mod py;
pub mod _py;
/// Implementation for the `download` module.
pub mod download;
@@ -29,4 +29,4 @@ pub mod panel;
/// PyO3 bindings for the `msyrs` Python API.
#[allow(unused_imports)]
use py::msyrs;
use _py::msyrs;

View File

@@ -48,6 +48,26 @@ fn flat_std(x: &Array1<f64>, remove_zeros: bool) -> f64 {
filtered_x.mapv(f64::abs).mean().unwrap_or(0.0)
}
// #[allow(dead_code)]
// fn single
/// Calculate historic volatility.
/// Arguments:
/// - `df`: A Quantamental DataFrame.
@@ -81,5 +101,46 @@ pub fn historic_vol(
) -> Result<DataFrame, Box<dyn std::error::Error>> {
println!("Calculating historic volatility with the following parameters:");
println!("xcat: {:?},\ncids: {:?},\nlback_periods: {:?},lback_method: {:?},\nhalf_life: {:?},\nstart: {:?},\nend: {:?},\nest_freq: {:?},\nremove_zeros: {:?},\npostfix: {:?},\nnan_tolerance: {:?}", xcat, cids, lback_periods,lback_method, half_life, start, end, est_freq, remove_zeros, postfix, nan_tolerance);
Ok(df.to_owned())
}