-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ticker format, test_utils, Makefile
- Loading branch information
1 parent
493ea31
commit 1260059
Showing
10 changed files
with
242 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
precommit: | ||
rustup update | ||
cargo update | ||
cargo check | ||
cargo fmt | ||
cargo t | ||
cargo clippy --fix --allow-dirty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
pub mod util; | ||
pub use util::*; | ||
|
||
#[cfg(test)] | ||
mod test_utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use anyhow::{Error, Result}; | ||
use polars::prelude::*; | ||
|
||
pub fn defualt_df(ticker: &[Option<&str>], company: &[Option<&str>]) -> Result<DataFrame, Error> { | ||
let target_len = ticker.len() + 1; | ||
let df = df![ | ||
"date" => vec!["2024-01-01"; target_len], | ||
"ticker" => [ticker, &[Some("TSLA")]].concat(), | ||
"cusip" => vec!["TESLA"; target_len], | ||
"company" => [company, &[Some("TESLA")]].concat(), | ||
"market_value" => vec![10; target_len], | ||
"shares" => vec![10; target_len], | ||
"share_price" => vec![100.00; target_len], | ||
"weight" => vec![10.00; target_len], | ||
]?; | ||
Ok(df) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pub mod data_source; | ||
pub use data_source::*; | ||
pub mod ticker; | ||
pub use ticker::*; |
Oops, something went wrong.