fix: normalize dynamic factor lookups

This commit is contained in:
boris
2026-04-24 05:05:03 -07:00
parent 99188487b8
commit 184074dcfe

View File

@@ -1988,7 +1988,8 @@ impl DataSet {
field: &str,
lookback: usize,
) -> Option<f64> {
match field {
let field = normalize_field(field);
match field.as_str() {
"close" | "prev_close" | "stock_close" | "price" => self
.market_series_by_symbol
.get(symbol)
@@ -2390,7 +2391,8 @@ fn industry_name_factor_aliases(source: &str, level: usize) -> Vec<String> {
}
fn factor_numeric_value(snapshot: &DailyFactorSnapshot, field: &str) -> Option<f64> {
match field {
let field = normalize_field(field);
match field.as_str() {
"market_cap" | "market_cap_bn" => Some(snapshot.market_cap_bn),
"free_float_cap" | "free_float_market_cap" | "free_float_cap_bn" => {
Some(snapshot.free_float_cap_bn)