mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Merge pull request #621 from Hestia-Homes/main
Upgrading rds storage type to gp3 to improve throttling issues
This commit is contained in:
commit
54dba37705
6 changed files with 31 additions and 6 deletions
|
|
@ -22,7 +22,6 @@ from recommendations.recommendation_utils import (
|
||||||
)
|
)
|
||||||
from backend.ml_models.AnnualBillSavings import AnnualBillSavings
|
from backend.ml_models.AnnualBillSavings import AnnualBillSavings
|
||||||
from backend.app.utils import sap_to_epc
|
from backend.app.utils import sap_to_epc
|
||||||
from backend.Funding import Funding
|
|
||||||
import backend.app.assumptions as assumptions
|
import backend.app.assumptions as assumptions
|
||||||
|
|
||||||
ENVIRONMENT = os.environ.get("ENVIRONMENT", "dev")
|
ENVIRONMENT = os.environ.get("ENVIRONMENT", "dev")
|
||||||
|
|
@ -340,7 +339,6 @@ class Property:
|
||||||
recommendation_record=recommendation_record,
|
recommendation_record=recommendation_record,
|
||||||
recommendations=property_representative_recommendations,
|
recommendations=property_representative_recommendations,
|
||||||
primary_recommendation_id=self.id,
|
primary_recommendation_id=self.id,
|
||||||
non_invasive_recommendations=self.non_invasive_recommendations,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return scoring_dict
|
return scoring_dict
|
||||||
|
|
@ -1243,7 +1241,8 @@ class Property:
|
||||||
"heat network": "Natural Gas (Community Scheme)",
|
"heat network": "Natural Gas (Community Scheme)",
|
||||||
"lpg": 'LPG',
|
"lpg": 'LPG',
|
||||||
"biodiesel": "Smokeless Fuel",
|
"biodiesel": "Smokeless Fuel",
|
||||||
"b30d": "B30K Biofuel"
|
"b30d": "B30K Biofuel",
|
||||||
|
"coal": "Coal",
|
||||||
}
|
}
|
||||||
|
|
||||||
self.heating_energy_source = list({
|
self.heating_energy_source = list({
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ from sqlmodel import Session
|
||||||
|
|
||||||
from etl.epc.Record import EPCRecord
|
from etl.epc.Record import EPCRecord
|
||||||
from sqlalchemy.exc import IntegrityError, OperationalError
|
from sqlalchemy.exc import IntegrityError, OperationalError
|
||||||
from sqlalchemy.orm import sessionmaker
|
|
||||||
from starlette.responses import Response
|
from starlette.responses import Response
|
||||||
from backend.app.BatterySapScorer import BatterySAPScorer
|
from backend.app.BatterySapScorer import BatterySAPScorer
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
"""
|
||||||
|
For the Peabody project, there were a number of subtasks that failed due to issues, with the most
|
||||||
|
prominent being errors with the property address and ID data.
|
||||||
|
|
||||||
|
This script will fetch those failed subtasks, get the associated properties and delete the properties
|
||||||
|
from the database so that the subtasks can be restarted cleanly.
|
||||||
|
|
||||||
|
Additionally, we wil find the problematic records and remove them
|
||||||
|
|
||||||
|
Given we ran an EPC C scenario, we should check how many properties, below EPC C we have, that have no plan
|
||||||
|
or recommendations in case something went wrong
|
||||||
|
"""
|
||||||
|
|
@ -697,8 +697,12 @@ class TrainingDataset(BaseDataset):
|
||||||
for x in missing_descriptions:
|
for x in missing_descriptions:
|
||||||
desc_cleaner = cleaner(x)
|
desc_cleaner = cleaner(x)
|
||||||
cleaned = desc_cleaner.process()
|
cleaned = desc_cleaner.process()
|
||||||
# IF NODATA, REMAP TO NONE VALUES
|
# IF NODATA, REMAP TO NONE VALUES, apart from walls which we want to keep as is
|
||||||
if all((pd.DataFrame(cleaned, index=[0]).T)[0] == False):
|
# If we convert the walls data to None, we end up converting booleans to None which
|
||||||
|
# causes issues downstream
|
||||||
|
if all(
|
||||||
|
(pd.DataFrame(cleaned, index=[0]).T)[0] == False
|
||||||
|
) and component != "walls":
|
||||||
cleaned = {key: None for key in cleaned.keys()}
|
cleaned = {key: None for key in cleaned.keys()}
|
||||||
cleaned_data.append(
|
cleaned_data.append(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,10 @@ resource "aws_db_instance" "default" {
|
||||||
ca_cert_identifier = "rds-ca-rsa2048-g1"
|
ca_cert_identifier = "rds-ca-rsa2048-g1"
|
||||||
# Temporary to enfore immediate change
|
# Temporary to enfore immediate change
|
||||||
apply_immediately = true
|
apply_immediately = true
|
||||||
|
# Set up storage type to gp3 for better performance
|
||||||
|
storage_type = "gp3"
|
||||||
|
iops = 3000
|
||||||
|
storage_throughput = 125
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set up the bucket that recieve the csv uploads of epc to be retrofit
|
# Set up the bucket that recieve the csv uploads of epc to be retrofit
|
||||||
|
|
|
||||||
|
|
@ -698,6 +698,13 @@ class Recommendations:
|
||||||
"heating_cop": 0.85,
|
"heating_cop": 0.85,
|
||||||
"hotwater_cop": 0.85
|
"hotwater_cop": 0.85
|
||||||
}
|
}
|
||||||
|
if main_fuel_description in ['coal (community)']:
|
||||||
|
return {
|
||||||
|
"heating_fuel_type": "Coal",
|
||||||
|
"hotwater_fuel_type": "Coal",
|
||||||
|
"heating_cop": 0.85,
|
||||||
|
"hotwater_cop": 0.85
|
||||||
|
}
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Unhandled community fuel."
|
"Unhandled community fuel."
|
||||||
f"Fuel: {main_fuel_description}"
|
f"Fuel: {main_fuel_description}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue