The DataManager class

class data_manager.DataManager(influxdb_client, cfg, logger, influx_df_client=None)[source]

Bases: object

Generic interface for data (measures and forecasts) management

static aggregate_dataframes(inputs, func)[source]
static apply_function_to_forecast(func, i1, i2)[source]
static apply_function_to_measures(func, i1, i2)[source]
archive_file(file_name)[source]
calc_aggregated_data_for_given_period(from_str, to_str)[source]
calc_artificial_data_for_given_period(from_str, to_str)[source]
calc_kpis()[source]
calculate_artificial_data()[source]
static check_folder(folder)[source]
close_ftp_connection()[source]
create_aggregated_data()[source]
delete_remote_files()[source]
static digitalize_output(output, pars)[source]
download_remote_files()[source]
get_forecast_data(loc, sig, st_date, end_date)[source]
static get_loc_sig(locations, signals, func)[source]
get_measure_data(loc, sig, st_date, end_date)[source]
get_single_signals(fr)[source]
get_start_end_dates()[source]
handle_measures_file(file_path, file_name, dps)[source]
handle_meteo_forecasts_file(input_file, dps)[source]

Save measures data (OASI and ARPA) in InfluxDB

Parameters

input_file (string) – input file

insert_data()[source]
static is_float(s)[source]
is_meteosuisse_forecast_file(file_name)[source]
static mean_absolute_percentage_error(y_true, y_pred)[source]
open_ftp_connection()[source]
point_handling(dps, point)[source]

Add a point and (eventually) store the entire dataset in InfluxDB

Parameters
  • point (dict) – point to add

  • dps (list) – input data points

Returns

output data points

Return type

list

update_training_datasets(new_value, location)[source]

Update the output training dataset :param new_value: new output value :type new_value: float :param location: location related to the new value :type location: string

upload_file(file_to_send)[source]
data_manager.warn(*args, **kwargs)[source]