# BSGIP specific tools from c3x.data_loaders import configfileparser, nextgen_loaders, tariff_loaders from c3x.data_cleaning import cleaners from c3x.data_statistics import figure_of_merit config = configfileparser.ConfigFileParser("config/example_for_FoMs.ini") measurement_types = config.read_data_usage() data_usage = config.read_measurement_types() data_paths = config.read_data_path() data_files = [] # Create a nextGen data object that has working paths and can be sliced using batches next_gen = nextgen_loaders.NextGenData('FoM', source=data_paths['source'], batteries=data_paths["batteries"], solar=data_paths["solar"], loads=data_paths["loads"], node=data_paths["node"], results=data_paths["results"]) cleaned_data = next_gen.read_clean_data(data_usage["loads"], data_usage["solar"], data_usage["batteries"]) ##################### Figures of Merit ##################### property_id = next(iter(cleaned_data)) print("One Day of data exported for Property: ", property_id) phase = cleaned_data[property_id] load = phase["loads_"+str(property_id)] solar = phase["solar_" + str(property_id)] battery = phase["battery_" + str(property_id)] start = pandas.to_datetime("2019-01-23 00:05")
##################### Load and check data ##################### config = configfileparser.ConfigFileParser( "./scripts/config/example_for_cleaning.ini") data_paths = config.read_data_path() batch_info = config.read_batches() data_usage = config.read_data_usage() # Create a nextGen data object that has working paths and can be sliced using batches next_gen = nextgen_loaders.NextGenData( data_name='NextGen', source=data_paths["source"], batteries=data_paths["batteries"], solar=data_paths["solar"], node=data_paths["node"], loads=data_paths["loads"], results=data_paths["results"], number_of_batches=batch_info["number_of_batches"], files_per_batch=batch_info["files_per_batch"], concat_batches_start=batch_info["concat_batches_start"], concat_batches_end=batch_info["concat_batches_end"]) # concatenates batches of one data type to one file per node (data frames and separate network) for data_type in data_usage: next_gen.concat_data( meas_type=data_type, concat_batches_start=batch_info["concat_batches_start"], concat_batches_end=batch_info["concat_batches_end"]) ##################### Clean measurement data #####################