forked from 1b-agent/fieldcraft-upstream
results: Export CSV takes every parameter its description names (set, at, mode, frame, about)
results.export.csv's form listed only nodes and sets, so the parameter check refused the probe's set, at, mode and frame and the reactions' about point that the command documents. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
05dc20a70b
commit
c983987c64
2 files changed
+10
No files matched your search
@@ -1727,7 +1727,12 @@ pub const EXPORT_CSV: &[Field] = &[
|
||||
path("path", "File", true).help("The CSV file to write.").req(),
|
||||
SOLVED,
|
||||
references("sets", "Sets", C::Set).help("Reactions: the sets to sum; the step's BC sets when empty.").hint("the step's BC sets"),
|
||||
xyz("about", "About point", D::Length).help("Reactions: the point moments are taken about."),
|
||||
labels("nodes", "Nodes", LabelOf::Node).help("Probe: the node labels."),
|
||||
reference("set", "Set", C::Set).help("Probe: a set whose nodes to read."),
|
||||
points("at", "Points", D::Length, 10_000).help("Probe: points to read at the nearest nodes."),
|
||||
int("mode", "Mode", 1, 1_000_000).help("Probe: the mode to read, for frequency and buckling steps."),
|
||||
int("frame", "Frame", 0, 1_000_000_000).help("Probe: the frame to read, for explicit and transient steps."),
|
||||
];
|
||||
pub const REACTIONS: &[Field] = &[
|
||||
SOLVED,
|
||||
|
||||
@@ -621,6 +621,11 @@ mod tests {
|
||||
}
|
||||
assert!(!rows[0].iter().any(|h| h == "temperature"), "columns the step does not have are left out: {:?}", rows[0]);
|
||||
// A stale result is refused.
|
||||
// Every parameter the description names is taken: a set's nodes, points, a moment point.
|
||||
let set = s.execute("results.export.csv", &json!({"what": "probe", "path": path, "step": "Bend", "set": "tip"})).unwrap();
|
||||
assert!(set["rows"].as_u64().unwrap_or(0) > 0, "{set}");
|
||||
s.execute("results.export.csv", &json!({"what": "probe", "path": path, "step": "Bend", "at": [[0, 0, 0]]})).unwrap();
|
||||
s.execute("results.export.csv", &json!({"what": "reactions", "path": path, "step": "Bend", "about": [1, 0, 0]})).unwrap();
|
||||
s.execute("mesh.node.add", &json!({"label": 99_999, "xyz": [0, 0, 0]})).unwrap();
|
||||
assert!(s.execute("results.export.csv", &json!({"what": "reactions", "path": temp_csv("stale"), "step": "Bend"})).is_err());
|
||||
for p in ["reactions", "probe"] {
|
||||
|
||||
Reference in new issue
Block a user