Add model embeddings for Z-factor DoF, separate from SaturatedController.
Some checks failed
CI / check (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
Fixed/Free Probe calibration now emits embeddings[] (unknown + equation) instead of controls[], keeping SaturatedController for physical regulation only. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
40
crates/cli/tests/embeddings_reject_control_z.rs
Normal file
40
crates/cli/tests/embeddings_reject_control_z.rs
Normal file
@@ -0,0 +1,40 @@
|
||||
//! Z-factors must use embeddings[], not controls[]/SaturatedController.
|
||||
|
||||
use entropyk_cli::run::{run_simulation, SimulationStatus};
|
||||
use tempfile::tempdir;
|
||||
|
||||
#[test]
|
||||
fn controls_with_z_ua_are_rejected() {
|
||||
// Minimal config — reject happens before component graph build.
|
||||
let json = r#"
|
||||
{
|
||||
"fluid": "R134a",
|
||||
"fluid_backend": "Test",
|
||||
"circuits": [],
|
||||
"controls": [
|
||||
{
|
||||
"type": "SaturatedController",
|
||||
"id": "bad_calib",
|
||||
"measure": { "component": "sst", "output": "saturationTemperature" },
|
||||
"actuator": { "component": "evap", "factor": "z_ua", "initial": 1, "min": 0.05, "max": 3 },
|
||||
"target": 278.15
|
||||
}
|
||||
],
|
||||
"solver": { "strategy": "newton", "max_iterations": 10, "tolerance": 1e-6 }
|
||||
}
|
||||
"#;
|
||||
let dir = tempdir().unwrap();
|
||||
let path = dir.path().join("bad.json");
|
||||
std::fs::write(&path, json).unwrap();
|
||||
let result = run_simulation(&path, None, false).unwrap();
|
||||
assert!(
|
||||
matches!(result.status, SimulationStatus::Error),
|
||||
"expected Error, got {:?}",
|
||||
result.status
|
||||
);
|
||||
let err = result.error.unwrap_or_default();
|
||||
assert!(
|
||||
err.contains("embeddings") && err.contains("z_ua"),
|
||||
"error should point to embeddings[], got: {err}"
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user