为原生因子研究冻结计算内核身份

This commit is contained in:
boris
2026-09-10 16:32:21 +08:00
parent 3fa1004ec5
commit 2473cc04bb
2 changed files with 14 additions and 1 deletions
@@ -15,6 +15,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
io::stdin().read_to_string(&mut input)?;
let output = if input.trim().is_empty() {
factor_events::catalog()
} else if serde_json::from_str::<Value>(&input)?.get("rank_history").is_some() {
#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
struct Rank { dates:Vec<chrono::NaiveDate>, universe:Vec<String>, values:std::collections::BTreeMap<String,Vec<Option<f64>>> }
let value:Value=serde_json::from_str(&input)?;
let request:Rank=serde_json::from_value(value["rank_history"].clone())?;
json!({"result":fidc_core::factor_cross_section::rank_history(&request.dates,&request.universe,&request.values)?})
} else {
let request: Request = serde_json::from_str(&input)?;
let results = request