pub struct TimeLoad {
pub time: Vec<DateTime<FixedOffset>>,
pub load: Vec<f64>,
}
Expand description
The main struct for the load time series.
Fields§
§time: Vec<DateTime<FixedOffset>>
§load: Vec<f64>
Implementations§
Source§impl TimeLoad
impl TimeLoad
Sourcepub fn new(capacity: usize) -> TimeLoad
pub fn new(capacity: usize) -> TimeLoad
Initiate a new TimeLoad instance using the given capacity for the time and load vectors
Sourcepub fn from_csv<P>(fin: P) -> TimeLoad
pub fn from_csv<P>(fin: P) -> TimeLoad
Initiate a TimeLoad from csv setting load to NAN in case of load parsing errors, but panic for datatime errors. Do not check the continuity of the time series and presence of error flags, these are checked separately afterwards
pub fn is_ordered(&self)
pub fn is_ordered_and_continuous(&self)
Sourcepub fn fill_missing_with_nan(&self) -> TimeLoad
pub fn fill_missing_with_nan(&self) -> TimeLoad
Fill the datetime gaps with NAN to have continuous datetime. Take a reference to the read TimeLoad and return a new continuous TimeLoad. In fact, build a continuous datetime Vec and then match it with the load Vec? Use the minimum time interval in the data to determine the desired time step for the output.
Sourcepub fn replace_bad_datetimes_with_nan(
&mut self,
bad_datetimes: Vec<DateTime<FixedOffset>>,
)
pub fn replace_bad_datetimes_with_nan( &mut self, bad_datetimes: Vec<DateTime<FixedOffset>>, )
Replace all values measured at the bad datetimes nan. Need to be given as DateTime for correct and easier comparison.
Sourcepub fn replace_bad_time_interval_with_nan(
&mut self,
time_init: NaiveTime,
time_stop: NaiveTime,
)
pub fn replace_bad_time_interval_with_nan( &mut self, time_init: NaiveTime, time_stop: NaiveTime, )
Replace all values measured within the time interval with nan. Given in standard time, fixed offset for the chosen timezone.
Sourcepub fn replace_outliers_with_nan(&mut self, min_load: f64, max_load: f64)
pub fn replace_outliers_with_nan(&mut self, min_load: f64, max_load: f64)
Set to NAN all the load values that are out of the expected range.
Sourcepub fn replace_errors_with_nan(&mut self, max_value: f64)
pub fn replace_errors_with_nan(&mut self, max_value: f64)
Consider all the values > max_value as invalid and replace them with NAN. These high values are used for the errors.