From 502661aafac84c90df9ff4a8441a54d252197dc2 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 8 Apr 2025 09:14:25 -0600 Subject: [PATCH 1/5] Reduce Julia containers by 50%, increase per container MemoryRequest by 20% --- .helm/values.production.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.helm/values.production.yaml b/.helm/values.production.yaml index e2c39fa8c..5549a8297 100644 --- a/.helm/values.production.yaml +++ b/.helm/values.production.yaml @@ -6,8 +6,8 @@ djangoMemoryLimit: "2000Mi" celeryReplicas: 10 celeryMemoryRequest: "900Mi" celeryMemoryLimit: "900Mi" -juliaReplicas: 15 +juliaReplicas: 10 juliaCpuRequest: "1000m" juliaCpuLimit: "4000m" -juliaMemoryRequest: "8000Mi" -juliaMemoryLimit: "8000Mi" +juliaMemoryRequest: "10000Mi" +juliaMemoryLimit: "10000Mi" From 58a84200f81d692af9dbe79f995dd2b433eb2fe2 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 10 Apr 2025 10:17:41 -0600 Subject: [PATCH 2/5] Reduce per pod memory to 8GB again and zero maxSurge --- .helm/values.production.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.helm/values.production.yaml b/.helm/values.production.yaml index 5549a8297..a585ffa13 100644 --- a/.helm/values.production.yaml +++ b/.helm/values.production.yaml @@ -9,5 +9,8 @@ celeryMemoryLimit: "900Mi" juliaReplicas: 10 juliaCpuRequest: "1000m" juliaCpuLimit: "4000m" -juliaMemoryRequest: "10000Mi" -juliaMemoryLimit: "10000Mi" +juliaMemoryRequest: "8000Mi" +juliaMemoryLimit: "8000Mi" +juliaDeploymentStrategy: + rollingUpdate: + maxSurge: 0% From 3bf049966c1025689074a9e179cf8a376532633c Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 21 Apr 2025 08:35:04 -0600 Subject: [PATCH 3/5] Avoid errors when trying to do math with values of type None - handle None as zero --- reoptjl/custom_table_config.py | 8 ++++---- reoptjl/custom_table_helpers.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reoptjl/custom_table_config.py b/reoptjl/custom_table_config.py index 34131f514..f12854ceb 100644 --- a/reoptjl/custom_table_config.py +++ b/reoptjl/custom_table_config.py @@ -411,14 +411,14 @@ { "label" : "Purchased Electricity Cost ($/yr)", "key" : "purchased_electricity_cost", - "bau_value" : lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_before_tax_bau") + safe_get(df, "outputs.CHP.year_one_standby_cost_before_tax_bau") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_before_tax_bau"), - "scenario_value": lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_before_tax") + safe_get(df, "outputs.CHP.year_one_standby_cost_before_tax") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_before_tax") + "bau_value" : lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_before_tax_bau") + safe_get(df, "outputs.Financial.year_one_chp_standby_cost_before_tax_bau") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_before_tax_bau"), + "scenario_value": lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_before_tax") + safe_get(df, "outputs.Financial.year_one_chp_standby_cost_before_tax") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_before_tax") }, { "label" : "Purchased Electricity Cost, After Tax ($/yr)", "key" : "purchased_electricity_cost", - "bau_value" : lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_after_tax_bau") + safe_get(df, "outputs.CHP.year_one_standby_cost_after_tax_bau") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_after_tax_bau"), - "scenario_value": lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_after_tax") + safe_get(df, "outputs.CHP.year_one_standby_cost_after_tax") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_after_tax") + "bau_value" : lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_after_tax_bau") + safe_get(df, "outputs.Financial.year_one_chp_standby_cost_after_tax_bau") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_after_tax_bau"), + "scenario_value": lambda df: safe_get(df, "outputs.ElectricTariff.year_one_bill_after_tax") + safe_get(df, "outputs.Financial.year_one_chp_standby_cost_after_tax") - safe_get(df, "outputs.ElectricTariff.year_one_export_benefit_after_tax") }, { "label" : "Electricity Cost Savings ($/yr)", diff --git a/reoptjl/custom_table_helpers.py b/reoptjl/custom_table_helpers.py index a27a3a649..5e56a9ca9 100644 --- a/reoptjl/custom_table_helpers.py +++ b/reoptjl/custom_table_helpers.py @@ -38,4 +38,6 @@ def colnum_string(n: int) -> str: return string def safe_get(df: Dict[str, Any], key: str, default: Any = 0) -> Any: - return df.get(key, default) \ No newline at end of file + """Safely get a value from a dictionary with a default fallback.""" + value = df.get(key, default if default is not None else 0) + return value if value is not None else 0 \ No newline at end of file From db0b50b4ca870fa3dcf27e74531672c87273f64f Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Mon, 21 Apr 2025 09:17:08 -0600 Subject: [PATCH 4/5] Update .helm/values.production.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .helm/values.production.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.helm/values.production.yaml b/.helm/values.production.yaml index a585ffa13..041ea45c1 100644 --- a/.helm/values.production.yaml +++ b/.helm/values.production.yaml @@ -13,4 +13,4 @@ juliaMemoryRequest: "8000Mi" juliaMemoryLimit: "8000Mi" juliaDeploymentStrategy: rollingUpdate: - maxSurge: 0% + maxSurge: "0%" From f04c38476e07ccec3131ad13a6e0c0186e07f17c Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Mon, 21 Apr 2025 09:19:48 -0600 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 133f9d65c..7ab57cf83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ Classify the change according to the following categories: ##### Removed ### Patches +## v3.12.2 +### Patches +- Enable the downloadable results spreadsheet (`job/generate_results_table` endpoint) to work with previous runs by avoiding errors when trying to do math with values of type None - handle None as zero/0 + ## v3.12.1 ### Minor Updates ### Added