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