Skip to main content

windmill_api/models/
cell_score.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.796.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CellScore : One scorer's verdict on one run, and how it compares with the baseline.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CellScore {
17    #[serde(rename = "scorer_id")]
18    pub scorer_id: String,
19    #[serde(rename = "score", skip_serializing_if = "Option::is_none")]
20    pub score: Option<f64>,
21    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
22    pub reason: Option<String>,
23    #[serde(rename = "checks", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub checks: Option<Option<serde_json::Value>>,
25    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
26    pub error: Option<String>,
27    /// The scorer read this case and had nothing to measure on it. Left out of the column's mean and pass rate rather than counted as a zero. 
28    #[serde(rename = "not_applicable", skip_serializing_if = "Option::is_none")]
29    pub not_applicable: Option<bool>,
30    /// A scoring job is still running for this cell.
31    #[serde(rename = "pending")]
32    pub pending: bool,
33    /// Which side of the scorer's `pass_if` threshold the score fell on. Absent when the column has no threshold, or has no score yet. 
34    #[serde(rename = "passed", skip_serializing_if = "Option::is_none")]
35    pub passed: Option<bool>,
36    /// The same scorer's number on the baseline experiment.
37    #[serde(rename = "baseline", skip_serializing_if = "Option::is_none")]
38    pub baseline: Option<f64>,
39    /// The baseline's score came from a different definition of this scorer, so the delta is a change of scorer as much as a change of agent. 
40    #[serde(rename = "definition_changed")]
41    pub definition_changed: bool,
42}
43
44impl CellScore {
45    /// One scorer's verdict on one run, and how it compares with the baseline.
46    pub fn new(scorer_id: String, pending: bool, definition_changed: bool) -> CellScore {
47        CellScore {
48            scorer_id,
49            score: None,
50            reason: None,
51            checks: None,
52            error: None,
53            not_applicable: None,
54            pending,
55            passed: None,
56            baseline: None,
57            definition_changed,
58        }
59    }
60}
61