MCPcopy Create free account
hub / github.com/Open-Quant/openquant / test_value_error_for_unknown_solution

Function test_value_error_for_unknown_solution

crates/openquant/tests/cla.rs:241–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239 assert!((cla.weights[2][0] - 0.2).abs() < 1e-12 && (cla.weights[2][1] - 0.8).abs() < 1e-12);
240 assert_eq!(cla.lambdas[2], 0.0);
241 assert_eq!(cla.free_weights[2].len(), 2);
242}
243
244#[test]
245fn test_value_error_for_non_date_index() {
246 let prices = load_asset_prices();
247 let bad = AssetPrices::new(prices.data.clone(), Vec::new());
248 let mut cla = CLA::default();
249 let err = cla.allocate(
250 Some(AssetPricesInput::Prices(&bad)),
251 None,
252 None,
253 None,
254 Some("cla_turning_points"),
255 );

Callers

nothing calls this directly

Calls 2

load_asset_pricesFunction · 0.85
allocateMethod · 0.45

Tested by

no test coverage detected