renamed set_features

This commit is contained in:
Khalim Conn-Kowlessar 2024-08-09 12:32:33 +01:00
parent f3c53847bf
commit fe80fa3036
2 changed files with 4 additions and 7 deletions

View file

@ -582,7 +582,7 @@ class Property:
return output
def get_components(
def set_features(
self,
cleaned,
kwh_client,

View file

@ -437,7 +437,7 @@ async def trigger_plan(body: PlanTriggerRequest):
epcs_for_scoring = kwh_client.transform(data=kwh_client.prepare_epc(input_properties), cleaned=cleaned)
kwh_predictions = model_api.predict_all(
kwh_preds = model_api.predict_all(
df=epcs_for_scoring,
bucket=get_settings().DATA_BUCKET,
prediction_buckets=get_prediction_buckets(),
@ -449,11 +449,8 @@ async def trigger_plan(body: PlanTriggerRequest):
logger.info("Getting spatial data")
input_properties = OpenUprnClient.set_spatial_data(input_properties, bucket_name=get_settings().DATA_BUCKET)
logger.info("Setting property components")
for p in tqdm(input_properties):
p.get_components(
cleaned=cleaned, kwh_client=kwh_client, kwh_predictions=kwh_predictions
)
logger.info("Setting property features")
[p.set_features(cleaned=cleaned, kwh_client=kwh_client, kwh_predictions=kwh_preds) for p in input_properties]
logger.info("Performing solar analysis")
# TODO: Tidy this up