perf(data): compact immutable snapshots with current execution rules

This commit is contained in:
boris
2026-09-12 16:02:24 +08:00
parent ffd23b9920
commit 828690a51e
22 changed files with 1430 additions and 1058 deletions
+15 -15
View File
@@ -8299,7 +8299,7 @@ mod tests {
let date = chrono::NaiveDate::from_ymd_opt(2025, 1, 2).expect("valid date");
DailyMarketSnapshot {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
timestamp: Some("2025-01-02 09:33:00".to_string()),
day_open: 10.0,
open: 10.0,
@@ -8425,7 +8425,7 @@ mod tests {
let date = chrono::NaiveDate::from_ymd_opt(2025, 1, 2).expect("valid date");
CandidateEligibility {
date,
symbol: "000001.SZ".to_string(),
symbol: "000001.SZ".into(),
is_st: false,
is_star_st: false,
is_new_listing: false,
@@ -8505,7 +8505,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut snapshot = limit_test_snapshot();
snapshot.symbol = (*symbol).to_string();
snapshot.symbol = (*symbol).into();
if block_exit && *symbol == "000001.SZ" {
snapshot.day_open = snapshot.lower_limit;
snapshot.open = snapshot.lower_limit;
@@ -8520,7 +8520,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut candidate = limit_test_candidate(true, true);
candidate.symbol = (*symbol).to_string();
candidate.symbol = (*symbol).into();
candidate
})
.collect::<Vec<_>>();
@@ -10479,7 +10479,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut snapshot = limit_test_snapshot();
snapshot.symbol = (*symbol).to_string();
snapshot.symbol = (*symbol).into();
if *symbol == "000001.SZ" {
snapshot.day_open = 9.0;
snapshot.open = 9.0;
@@ -10497,7 +10497,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut candidate = limit_test_candidate(true, true);
candidate.symbol = (*symbol).to_string();
candidate.symbol = (*symbol).into();
candidate
})
.collect::<Vec<_>>();
@@ -10631,7 +10631,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut snapshot = limit_test_snapshot();
snapshot.symbol = (*symbol).to_string();
snapshot.symbol = (*symbol).into();
snapshot
})
.collect::<Vec<_>>();
@@ -10639,7 +10639,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut candidate = limit_test_candidate(true, true);
candidate.symbol = (*symbol).to_string();
candidate.symbol = (*symbol).into();
candidate
})
.collect::<Vec<_>>();
@@ -10696,7 +10696,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut snapshot = limit_test_snapshot();
snapshot.symbol = (*symbol).to_string();
snapshot.symbol = (*symbol).into();
snapshot
})
.collect::<Vec<_>>();
@@ -10704,7 +10704,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut candidate = limit_test_candidate(true, true);
candidate.symbol = (*symbol).to_string();
candidate.symbol = (*symbol).into();
candidate
})
.collect::<Vec<_>>();
@@ -10834,7 +10834,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut snapshot = limit_test_snapshot();
snapshot.symbol = (*symbol).to_string();
snapshot.symbol = (*symbol).into();
snapshot
})
.collect::<Vec<_>>();
@@ -10842,7 +10842,7 @@ mod tests {
.iter()
.map(|symbol| {
let mut candidate = limit_test_candidate(true, true);
candidate.symbol = (*symbol).to_string();
candidate.symbol = (*symbol).into();
candidate
})
.collect::<Vec<_>>();
@@ -11623,7 +11623,7 @@ mod tests {
.with_volume_limit(false)
.with_liquidity_limit(false);
let mut snapshot = limit_test_snapshot();
snapshot.symbol = symbol.to_string();
snapshot.symbol = symbol.into();
snapshot.last_price = 4.21;
snapshot.close = 4.21;
snapshot.bid1 = 4.20;
@@ -11708,7 +11708,7 @@ mod tests {
.with_inactive_limit(false);
let snapshot = DailyMarketSnapshot {
date,
symbol: symbol.to_string(),
symbol: symbol.into(),
timestamp: Some("2023-05-08 15:00:00".to_string()),
day_open: 5.86,
open: 5.86,
@@ -11756,7 +11756,7 @@ mod tests {
Vec::new(),
vec![CandidateEligibility {
date,
symbol: symbol.to_string(),
symbol: symbol.into(),
is_st: false,
is_star_st: false,
is_new_listing: false,