Skip to content

Commit

Permalink
update data cleaning for generators and scheduled loads table
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-gorman committed May 16, 2024
1 parent 7fbc99f commit e2f21e6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions nemosis/data_fetch_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ def static_table(
else:
table = _filters.filter_on_column_value(table, filter_cols, filter_values)

table = static_data_finaliser_map[table_name](table, table_name)
static_table_finalisers = static_data_finaliser_map[table_name]
for finaliser in static_table_finalisers:
table = finaliser(table, table_name)

return table

Expand Down Expand Up @@ -407,6 +409,12 @@ def _finalise_excel_data(data, table_name):
return data


def _finalise_generators_and_scheduled_loads(data, table_name):
data = data.replace(to_replace=['', ' '], value='-')
data = data.fillna('-')
return data


def _finalise_csv_data(data, table_name):
return data

Expand All @@ -426,10 +434,10 @@ def _finalise_csv_data(data, table_name):
}

static_data_finaliser_map = {
"VARIABLES_FCAS_4_SECOND": _finalise_csv_data,
"ELEMENTS_FCAS_4_SECOND": _finalise_csv_data,
"Generators and Scheduled Loads": _finalise_excel_data,
"FCAS Providers": _finalise_excel_data,
"VARIABLES_FCAS_4_SECOND": [_finalise_csv_data],
"ELEMENTS_FCAS_4_SECOND": [_finalise_csv_data],
"Generators and Scheduled Loads": [_finalise_excel_data, _finalise_generators_and_scheduled_loads],
"FCAS Providers": [_finalise_excel_data],
}


Expand Down

0 comments on commit e2f21e6

Please sign in to comment.