Skip to content

Commit 0312cc5

Browse files
committed
mp projection reconstruct
Fix imports in projection_mp.rs after merge Update mp projection
1 parent 42f4af0 commit 0312cc5

File tree

17 files changed

+169
-122
lines changed

17 files changed

+169
-122
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
mod assumptions;
2-
mod model_points;
2+
mod mp_gen;
33
mod projections;
44

55
use crate::assumptions::assumption_scenario::AssumptionScenario;
6-
use crate::model_points::generate_model_points;
6+
use crate::mp_gen::pricing_mp_gen::generate_s_model_points; // Removed because function does not exist
77
use crate::projections::projection_multi_runs::RunsSetup;
88
use crate::projections::projection_single_run::SingleRunSetup;
99

@@ -14,7 +14,7 @@ use std::time::Instant;
1414
// PRIVATE
1515
//---------------------------------------------------------------------------------------------------------
1616
fn get_run_setups() -> PolarsResult<RunsSetup> {
17-
let model_points_df = generate_model_points(10_000, 987654321)?;
17+
let model_points_df = generate_s_model_points()?;
1818

1919
let run_setup_01 = SingleRunSetup {
2020
description: "Run setup 01 - Used for pricing".to_string(),

src/model_points.rs

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/model_points/asl_se_mp_gen.rs

Whitespace-only changes.

src/model_points/se_mp_gen.rs

Whitespace-only changes.

src/mp_gen.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
use crate::projections::projection_mp::ModelPoint;
2+
use ndarray::prelude::*;
3+
use ndarray_rand::RandomExt;
4+
use ndarray_rand::rand::SeedableRng;
5+
use ndarray_rand::rand::rngs::StdRng;
6+
use ndarray_rand::rand_distr::Uniform;
7+
use polars::prelude::*;
8+
9+
pub mod asl_se_mp_gen;
10+
pub mod pricing_mp_gen;
11+
pub mod s_mp_gen;
12+
pub mod se_mp_gen;
13+
14+
//---------------------------------------------------------------------------------------------------------
15+
// PUBLIC
16+
//---------------------------------------------------------------------------------------------------------
17+
// pub fn convert_model_points_df_to_vector(df: &DataFrame) -> PolarsResult<Vec<ModelPoint>> {
18+
// let id = df.column("id")?.i32()?;
19+
// let entry_age = df.column("entry_age")?.i32()?;
20+
// let gender = df.column("gender")?.str()?;
21+
// let term = df.column("term")?.i32()?;
22+
// let policy_count = df.column("policy_count")?.f64()?;
23+
// let sum_insured = df.column("sum_insured")?.f64()?;
24+
// let model = df.column("model")?.str()?;
25+
26+
// let model_points = (0..df.height())
27+
// .map(|i| ModelPoint {
28+
// id: id.get(i).unwrap(),
29+
// entry_age: entry_age.get(i).unwrap(),
30+
// gender: gender.get(i).unwrap().to_string(),
31+
// term: term.get(i).unwrap(),
32+
// policy_count: policy_count.get(i).unwrap(),
33+
// sum_insured: sum_insured.get(i).unwrap(),
34+
// model: model.get(i).unwrap().to_string(),
35+
// })
36+
// .collect();
37+
38+
// Ok(model_points)
39+
// }

src/mp_gen/asl_se_mp_gen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
File renamed without changes.
File renamed without changes.

src/mp_gen/se_mp_gen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/projections.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mod helpers;
2-
mod projection_mp;
2+
pub mod projection_mp;
33
pub mod projection_multi_runs;
4-
mod projection_single_run;
4+
pub mod projection_single_run;

0 commit comments

Comments
 (0)