mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Merge pull request #931 from Hestia-Homes/main
Some checks are pending
Fast Api Backend Deploy / deploy (push) Waiting to run
Deploy infrastructure / determine_stage (push) Waiting to run
Deploy infrastructure / shared_terraform (push) Blocked by required conditions
Deploy infrastructure / ara_engine_image (push) Blocked by required conditions
Deploy infrastructure / ara_engine_lambda (push) Blocked by required conditions
Deploy infrastructure / address2uprn_image (push) Blocked by required conditions
Deploy infrastructure / address2uprn_lambda (push) Blocked by required conditions
Deploy infrastructure / postcodeSplitter_image (push) Blocked by required conditions
Deploy infrastructure / postcodeSplitter_lambda (push) Blocked by required conditions
Deploy infrastructure / condition_etl_image (push) Blocked by required conditions
Deploy infrastructure / condition_etl_lambda (push) Blocked by required conditions
Deploy infrastructure / categorisation_image (push) Blocked by required conditions
Deploy infrastructure / categorisation_lambda (push) Blocked by required conditions
Deploy infrastructure / ordnanceSurvey_image (push) Blocked by required conditions
Deploy infrastructure / ordnanceSurvey_lambda (push) Blocked by required conditions
Deploy infrastructure / pashub_to_ara_image (push) Blocked by required conditions
Deploy infrastructure / pashub_to_ara_lambda (push) Blocked by required conditions
Deploy infrastructure / fast_api_lambda (push) Blocked by required conditions
Deploy infrastructure / cloudfront_acm (push) Blocked by required conditions
Deploy infrastructure / cloudfront_cdn (push) Blocked by required conditions
Some checks are pending
Fast Api Backend Deploy / deploy (push) Waiting to run
Deploy infrastructure / determine_stage (push) Waiting to run
Deploy infrastructure / shared_terraform (push) Blocked by required conditions
Deploy infrastructure / ara_engine_image (push) Blocked by required conditions
Deploy infrastructure / ara_engine_lambda (push) Blocked by required conditions
Deploy infrastructure / address2uprn_image (push) Blocked by required conditions
Deploy infrastructure / address2uprn_lambda (push) Blocked by required conditions
Deploy infrastructure / postcodeSplitter_image (push) Blocked by required conditions
Deploy infrastructure / postcodeSplitter_lambda (push) Blocked by required conditions
Deploy infrastructure / condition_etl_image (push) Blocked by required conditions
Deploy infrastructure / condition_etl_lambda (push) Blocked by required conditions
Deploy infrastructure / categorisation_image (push) Blocked by required conditions
Deploy infrastructure / categorisation_lambda (push) Blocked by required conditions
Deploy infrastructure / ordnanceSurvey_image (push) Blocked by required conditions
Deploy infrastructure / ordnanceSurvey_lambda (push) Blocked by required conditions
Deploy infrastructure / pashub_to_ara_image (push) Blocked by required conditions
Deploy infrastructure / pashub_to_ara_lambda (push) Blocked by required conditions
Deploy infrastructure / fast_api_lambda (push) Blocked by required conditions
Deploy infrastructure / cloudfront_acm (push) Blocked by required conditions
Deploy infrastructure / cloudfront_cdn (push) Blocked by required conditions
Deploy patch
This commit is contained in:
commit
c78560eb21
4 changed files with 18 additions and 8 deletions
|
|
@ -174,6 +174,8 @@ async def trigger_plan_entrypoint(body: PlanTriggerRequest):
|
||||||
service="plan_engine",
|
service="plan_engine",
|
||||||
inputs=data,
|
inputs=data,
|
||||||
task_only=True,
|
task_only=True,
|
||||||
|
source=SourceEnum.PORTFOLIO,
|
||||||
|
source_id=str(body.portfolio_id),
|
||||||
)
|
)
|
||||||
|
|
||||||
subtask_interface = SubTaskInterface()
|
subtask_interface = SubTaskInterface()
|
||||||
|
|
@ -222,6 +224,8 @@ async def trigger_plan_entrypoint(body: PlanTriggerRequest):
|
||||||
service="plan_engine",
|
service="plan_engine",
|
||||||
inputs=data,
|
inputs=data,
|
||||||
task_only=False,
|
task_only=False,
|
||||||
|
source=SourceEnum.PORTFOLIO,
|
||||||
|
source_id=str(body.portfolio_id),
|
||||||
)
|
)
|
||||||
data["task_id"] = str(task_id)
|
data["task_id"] = str(task_id)
|
||||||
data["subtask_id"] = str(subtask_id)
|
data["subtask_id"] = str(subtask_id)
|
||||||
|
|
|
||||||
|
|
@ -134,10 +134,18 @@ def handler(event: Mapping[str, Any], context: Optional[Any]) -> Mapping[str, Un
|
||||||
body_dict = {
|
body_dict = {
|
||||||
"task_id": "test",
|
"task_id": "test",
|
||||||
"subtask_id": "test",
|
"subtask_id": "test",
|
||||||
"portfolio_id": 569,
|
"portfolio_id": 655,
|
||||||
"scenario_ids": [],
|
"scenario_ids": [],
|
||||||
"default_plans_only": True,
|
"default_plans_only": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body_dict = {
|
||||||
|
"task_id": "test",
|
||||||
|
"subtask_id": "test",
|
||||||
|
"portfolio_id": 655,
|
||||||
|
"scenario_ids": [1174],
|
||||||
|
"default_plans_only": False,
|
||||||
|
}
|
||||||
:param event: Lambda event containing export request details
|
:param event: Lambda event containing export request details
|
||||||
:param context: Lambda context (not used in this handler but included for completeness)
|
:param context: Lambda context (not used in this handler but included for completeness)
|
||||||
:return: HTTP response indicating success or failure of the export operation
|
:return: HTTP response indicating success or failure of the export operation
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@ import os
|
||||||
import pickle
|
import pickle
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pytest
|
import pytest
|
||||||
|
from datetime import datetime
|
||||||
|
from backend.ml_models.api import ModelApi
|
||||||
|
from backend.app.utils import sap_to_epc
|
||||||
|
from backend.app.config import get_prediction_buckets
|
||||||
|
|
||||||
|
|
||||||
def load_sample_certificates():
|
def load_sample_certificates():
|
||||||
|
|
@ -60,12 +64,6 @@ def load_cleaning_data():
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
||||||
def test_rebaselining_pipeline_with_real_data():
|
def test_rebaselining_pipeline_with_real_data():
|
||||||
import pandas as pd
|
|
||||||
from datetime import datetime
|
|
||||||
from backend.ml_models.api import ModelApi
|
|
||||||
from backend.app.utils import sap_to_epc
|
|
||||||
from backend.app.config import get_prediction_buckets
|
|
||||||
|
|
||||||
df = load_sample_certificates()
|
df = load_sample_certificates()
|
||||||
cleaning_data = load_cleaning_data()
|
cleaning_data = load_cleaning_data()
|
||||||
input_properties = [make_property_from_row(row, cleaning_data=cleaning_data) for _, row in df.iterrows()]
|
input_properties = [make_property_from_row(row, cleaning_data=cleaning_data) for _, row in df.iterrows()]
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ class Costs:
|
||||||
# Try and get the region after converting the keys to lower
|
# Try and get the region after converting the keys to lower
|
||||||
self.region = {
|
self.region = {
|
||||||
k.lower(): v for k, v in county_to_region_map.items()
|
k.lower(): v for k, v in county_to_region_map.items()
|
||||||
}.get(self.property.property.epc_record.local_authority_label.lower(), None)
|
}.get(self.property.epc_record.local_authority_label.lower(), None)
|
||||||
|
|
||||||
if self.region is None:
|
if self.region is None:
|
||||||
logger.warning("No region found for county %s, defaulting to South East England",
|
logger.warning("No region found for county %s, defaulting to South East England",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue