scouter_client/data_utils/
types.rs

1use pyo3::prelude::*;
2
3pub type ConvertedData<'py> = (
4    Vec<String>,
5    Option<Bound<'py, PyAny>>,
6    Option<String>,
7    Vec<String>,
8    Option<Vec<Vec<String>>>,
9);
10
11pub struct DataTypes {
12    pub integer_features: Vec<String>,
13    pub float_features: Vec<String>,
14    pub string_features: Vec<String>,
15    pub numeric_features: Vec<String>,
16}
17
18impl DataTypes {
19    pub fn new(
20        integer_features: Vec<String>,
21        float_features: Vec<String>,
22        string_features: Vec<String>,
23    ) -> Self {
24        let numeric_features = integer_features
25            .iter()
26            .chain(float_features.iter())
27            .cloned()
28            .collect();
29        Self {
30            integer_features,
31            float_features,
32            string_features,
33            numeric_features,
34        }
35    }
36
37    pub fn has_mixed_types(&self) -> bool {
38        !self.integer_features.is_empty() && !self.float_features.is_empty()
39    }
40}
41
42pub enum NumericType {
43    Integer,
44    Float,
45}