From aac4dd5b81d5544b19d1dcf43fb4b36385be7841 Mon Sep 17 00:00:00 2001 From: Rathod Date: Tue, 20 Dec 2022 11:09:07 -0500 Subject: [PATCH 01/92] Revive Boiler tech and migration file --- .../0016_boilerinputs_boileroutputs.py | 52 +++ job/models.py | 338 +++++++++--------- job/src/process_results.py | 6 +- job/validators.py | 5 +- job/views.py | 14 +- 5 files changed, 231 insertions(+), 184 deletions(-) create mode 100644 job/migrations/0016_boilerinputs_boileroutputs.py diff --git a/job/migrations/0016_boilerinputs_boileroutputs.py b/job/migrations/0016_boilerinputs_boileroutputs.py new file mode 100644 index 000000000..f0c852315 --- /dev/null +++ b/job/migrations/0016_boilerinputs_boileroutputs.py @@ -0,0 +1,52 @@ +# Generated by Django 4.0.7 on 2022-12-20 16:07 + +import django.contrib.postgres.fields +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import job.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0015_coolingloadinputs_coolingloadoutputs_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='BoilerInputs', + fields=[ + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerInputs', serialize=False, to='job.apimeta')), + ('min_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), + ('max_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), + ('efficiency', models.FloatField(default=0.8, help_text='New boiler system efficiency - conversion of fuel to usable heating thermal energy.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('fuel_cost_per_mmbtu', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='Fuel cost in [$/MMBtu]', size=None)), + ('macrs_option_years', models.IntegerField(blank=True, choices=[(0, 'Zero'), (5, 'Five'), (7, 'Seven')], default=0, help_text='Duration over which accelerated depreciation will occur. Set to zero to disable', null=True)), + ('macrs_bonus_fraction', models.FloatField(blank=True, default=0.0, help_text='Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])), + ('installed_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=293000.0, help_text='Thermal power-based cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), + ('om_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=2930.0, help_text='Thermal power-based fixed O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), + ('om_cost_per_mmbtu', models.FloatField(blank=True, default=0.0, help_text='Thermal energy-based variable O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), + ('fuel_type', models.TextField(blank=True, choices=[('natural_gas', 'Natural Gas'), ('landfill_bio_gas', 'Landfill Bio Gas'), ('propane', 'Propane'), ('diesel_oil', 'Diesel Oil'), ('uranium', 'Uranium')], default='natural_gas', help_text='Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil, uranium', null=True)), + ('can_supply_steam_turbine', models.BooleanField(blank=True, default=True, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True)), + ], + bases=(job.models.BaseModel, models.Model), + ), + migrations.CreateModel( + name='BoilerOutputs', + fields=[ + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerOutputs', serialize=False, to='job.apimeta')), + ('year_one_fuel_consumption_mmbtu', models.FloatField(blank=True, null=True)), + ('year_one_fuel_consumption_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('lifecycle_fuel_cost', models.FloatField(blank=True, null=True)), + ('lifecycle_per_unit_prod_om_costs', models.FloatField(blank=True, null=True)), + ('lifecycle_fuel_cost_bau', models.FloatField(blank=True, null=True)), + ('year_one_thermal_production_mmbtu', models.FloatField(blank=True, null=True)), + ('year_one_fuel_cost', models.FloatField(blank=True, null=True)), + ('thermal_to_tes_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('year_one_thermal_production_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('year_one_thermal_to_load_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ], + bases=(job.models.BaseModel, models.Model), + ), + ] diff --git a/job/models.py b/job/models.py index 92b725ca0..ce23cb2e9 100644 --- a/job/models.py +++ b/job/models.py @@ -4439,177 +4439,171 @@ def clean(self): # perform custom validation here. pass -# # Uncomment to enable Boiler functionality -# class BoilerInputs(BaseModel, models.Model): -# key = "Boiler" - -# meta = models.OneToOneField( -# APIMeta, -# on_delete=models.CASCADE, -# related_name="BoilerInputs", -# primary_key=True -# ) - -# FUEL_TYPE_LIST = models.TextChoices('FUEL_TYPE_LIST', ( -# "natural_gas", -# "landfill_bio_gas", -# "propane", -# "diesel_oil", -# "uranium" -# )) - -# min_mmbtu_per_hour = models.FloatField( -# validators=[ -# MinValueValidator(0.0), -# MaxValueValidator(1.0e9) -# ], -# null=True, -# blank=True, -# default=0.0, -# help_text="Minimum thermal power size" -# ) - -# max_mmbtu_per_hour = models.FloatField( -# validators=[ -# MinValueValidator(0.0), -# MaxValueValidator(1.0e9) -# ], -# null=True, -# blank=True, -# default=0.0, -# help_text="Maximum thermal power size" -# ) - -# efficiency = models.FloatField( -# validators=[ -# MinValueValidator(0.0), -# MaxValueValidator(1.0) -# ], -# null=True, -# blank=True, -# default=0.8, -# help_text="New boiler system efficiency - conversion of fuel to usable heating thermal energy." -# ) - -# fuel_cost_per_mmbtu = ArrayField( -# models.FloatField( -# blank=True, -# validators=[ -# MinValueValidator(0) -# ] -# ), -# default=list, -# blank=True, -# help_text="Fuel cost in [$/MMBtu]" -# ) - -# macrs_option_years = models.IntegerField( -# default=MACRS_YEARS_CHOICES.ZERO, -# choices=MACRS_YEARS_CHOICES.choices, -# blank=True, -# null=True, -# help_text="Duration over which accelerated depreciation will occur. Set to zero to disable" -# ) - -# macrs_bonus_fraction = models.FloatField( -# default=0.0, -# validators=[ -# MinValueValidator(0), -# MaxValueValidator(1) -# ], -# blank=True, -# null=True, -# help_text="Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation" -# ) - -# installed_cost_per_mmbtu_per_hour = models.FloatField( -# default=293000.0, -# validators=[ -# MinValueValidator(0), -# MaxValueValidator(1.0e9) -# ], -# blank=True, -# null=True, -# help_text="Thermal power-based cost" -# ) - -# om_cost_per_mmbtu_per_hour = models.FloatField( -# default=2930.0, -# validators=[ -# MinValueValidator(0), -# MaxValueValidator(1.0e9) -# ], -# blank=True, -# null=True, -# help_text="Thermal power-based fixed O&M cost" -# ) - -# om_cost_per_mmbtu = models.FloatField( -# default=0.0, -# validators=[ -# MinValueValidator(0), -# MaxValueValidator(1.0e9) -# ], -# blank=True, -# null=True, -# help_text="Thermal energy-based variable O&M cost" -# ) - -# fuel_type = models.TextField( -# default=FUEL_TYPE_LIST.natural_gas, -# choices=FUEL_TYPE_LIST.choices, -# blank=True, -# null=True, -# help_text="Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil, uranium" -# ) - -# can_supply_steam_turbine = models.BooleanField( -# default=True, -# blank=True, -# null=True, -# help_text="If the boiler can supply steam to the steam turbine for electric production" -# ) - -# # For custom validations within model. -# def clean(self): -# self.fuel_cost_per_mmbtu = scalar_to_vector(self.fuel_cost_per_mmbtu) - -# class BoilerOutputs(BaseModel, models.Model): - -# key = "Boiler" - -# meta = models.OneToOneField( -# APIMeta, -# on_delete=models.CASCADE, -# related_name="BoilerOutputs", -# primary_key=True -# ) - -# year_one_fuel_consumption_mmbtu = models.FloatField(null=True, blank=True) - -# year_one_fuel_consumption_mmbtu_per_hour = ArrayField( -# models.FloatField(null=True, blank=True), -# default=list, -# ) - -# lifecycle_fuel_cost = models.FloatField(null=True, blank=True) -# lifecycle_per_unit_prod_om_costs = models.FloatField(null=True, blank=True) -# lifecycle_fuel_cost_bau = models.FloatField(null=True, blank=True) -# year_one_thermal_production_mmbtu = models.FloatField(null=True, blank=True) -# year_one_fuel_cost = models.FloatField(null=True, blank=True) +class BoilerInputs(BaseModel, models.Model): + key = "Boiler" + + meta = models.OneToOneField( + APIMeta, + on_delete=models.CASCADE, + related_name="BoilerInputs", + primary_key=True + ) + + FUEL_TYPE_LIST = models.TextChoices('FUEL_TYPE_LIST', ( + "natural_gas", + "landfill_bio_gas", + "propane", + "diesel_oil", + "uranium" + )) + + min_mmbtu_per_hour = models.FloatField( + validators=[ + MinValueValidator(0.0), + MaxValueValidator(MAX_BIG_NUMBER) + ], + default=0.0, + help_text="Minimum thermal power size" + ) + + max_mmbtu_per_hour = models.FloatField( + validators=[ + MinValueValidator(0.0), + MaxValueValidator(MAX_BIG_NUMBER) + ], + default=0.0, + help_text="Maximum thermal power size" + ) + + efficiency = models.FloatField( + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0) + ], + null=True, + default=0.8, + help_text="New boiler system efficiency - conversion of fuel to usable heating thermal energy." + ) + + fuel_cost_per_mmbtu = ArrayField( + models.FloatField( + blank=True, + validators=[ + MinValueValidator(0) + ] + ), + default=list, + blank=True, + help_text="Fuel cost in [$/MMBtu]" + ) + + macrs_option_years = models.IntegerField( + default=MACRS_YEARS_CHOICES.ZERO, + choices=MACRS_YEARS_CHOICES.choices, + blank=True, + null=True, + help_text="Duration over which accelerated depreciation will occur. Set to zero to disable" + ) + + macrs_bonus_fraction = models.FloatField( + default=0.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(1) + ], + blank=True, + null=True, + help_text="Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation" + ) + + installed_cost_per_mmbtu_per_hour = models.FloatField( + default=293000.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(MAX_BIG_NUMBER) + ], + blank=True, + null=True, + help_text="Thermal power-based cost" + ) + + om_cost_per_mmbtu_per_hour = models.FloatField( + default=2930.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(MAX_BIG_NUMBER) + ], + blank=True, + null=True, + help_text="Thermal power-based fixed O&M cost" + ) + + om_cost_per_mmbtu = models.FloatField( + default=0.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(MAX_BIG_NUMBER) + ], + blank=True, + null=True, + help_text="Thermal energy-based variable O&M cost" + ) + + fuel_type = models.TextField( + default=FUEL_TYPE_LIST.natural_gas, + choices=FUEL_TYPE_LIST.choices, + blank=True, + null=True, + help_text="Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil, uranium" + ) + + can_supply_steam_turbine = models.BooleanField( + default=True, + blank=True, + null=True, + help_text="If the boiler can supply steam to the steam turbine for electric production" + ) + + # For custom validations within model. + def clean(self): + self.fuel_cost_per_mmbtu = scalar_to_vector(self.fuel_cost_per_mmbtu) + +class BoilerOutputs(BaseModel, models.Model): + + key = "Boiler" + + meta = models.OneToOneField( + APIMeta, + on_delete=models.CASCADE, + related_name="BoilerOutputs", + primary_key=True + ) + + year_one_fuel_consumption_mmbtu = models.FloatField(null=True, blank=True) + + year_one_fuel_consumption_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default=list, + ) + + lifecycle_fuel_cost = models.FloatField(null=True, blank=True) + lifecycle_per_unit_prod_om_costs = models.FloatField(null=True, blank=True) + lifecycle_fuel_cost_bau = models.FloatField(null=True, blank=True) + year_one_thermal_production_mmbtu = models.FloatField(null=True, blank=True) + year_one_fuel_cost = models.FloatField(null=True, blank=True) -# thermal_to_tes_series_mmbtu_per_hour = ArrayField( -# models.FloatField(null=True, blank=True), -# default = list, -# ) -# year_one_thermal_production_mmbtu_per_hour = ArrayField( -# models.FloatField(null=True, blank=True), -# default = list, -# ) -# year_one_thermal_to_load_series_mmbtu_per_hour = ArrayField( -# models.FloatField(null=True, blank=True), -# default = list, -# ) + thermal_to_tes_series_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + year_one_thermal_production_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + year_one_thermal_to_load_series_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) class SpaceHeatingLoadInputs(BaseModel, models.Model): @@ -5163,8 +5157,8 @@ def filter_none_and_empty_array(d:dict): try: d["ExistingChiller"] = filter_none_and_empty_array(meta.ExistingChillerInputs.dict) except: pass - # try: d["Boiler"] = filter_none_and_empty_array(meta.BoilerInputs.dict) - # except: pass + try: d["Boiler"] = filter_none_and_empty_array(meta.BoilerInputs.dict) + except: pass try: d["ExistingBoiler"] = filter_none_and_empty_array(meta.ExistingBoilerInputs.dict) except: pass diff --git a/job/src/process_results.py b/job/src/process_results.py index 8dec1e8e7..d9d562d68 100644 --- a/job/src/process_results.py +++ b/job/src/process_results.py @@ -30,7 +30,7 @@ from job.models import FinancialOutputs, APIMeta, PVOutputs, ElectricStorageOutputs, ElectricTariffOutputs, SiteOutputs,\ ElectricUtilityOutputs, GeneratorOutputs, ElectricLoadOutputs, WindOutputs, FinancialInputs, ElectricUtilityInputs,\ - ExistingBoilerOutputs, CHPOutputs, CHPInputs, ExistingChillerOutputs, CoolingLoadOutputs, HeatingLoadOutputs + ExistingBoilerOutputs, CHPOutputs, CHPInputs, ExistingChillerOutputs, CoolingLoadOutputs, HeatingLoadOutputs, BoilerOutputs import logging log = logging.getLogger(__name__) @@ -63,8 +63,8 @@ def process_results(results: dict, run_uuid: str) -> None: WindOutputs.create(meta=meta, **results["Wind"]).save() if "ExistingChiller" in results.keys(): ExistingChillerOutputs.create(meta=meta, **results["ExistingChiller"]).save() - # if "Boiler" in results.keys(): - # BoilerOutputs.create(meta=meta, **results["Boiler"]).save() + if "Boiler" in results.keys(): + BoilerOutputs.create(meta=meta, **results["Boiler"]).save() if "ExistingBoiler" in results.keys(): ExistingBoilerOutputs.create(meta=meta, **results["ExistingBoiler"]).save() if "HeatingLoad" in results.keys(): diff --git a/job/validators.py b/job/validators.py index bafa20465..19da1dddc 100644 --- a/job/validators.py +++ b/job/validators.py @@ -31,7 +31,7 @@ import pandas as pd from job.models import MAX_BIG_NUMBER, APIMeta, ExistingBoilerInputs, UserProvidedMeta, SiteInputs, Settings, ElectricLoadInputs, ElectricTariffInputs, \ FinancialInputs, BaseModel, Message, ElectricUtilityInputs, PVInputs, ElectricStorageInputs, GeneratorInputs, WindInputs, SpaceHeatingLoadInputs, \ - DomesticHotWaterLoadInputs, CHPInputs, CoolingLoadInputs, ExistingChillerInputs + DomesticHotWaterLoadInputs, CHPInputs, CoolingLoadInputs, ExistingChillerInputs, BoilerInputs from django.core.exceptions import ValidationError from pyproj import Proj from typing import Tuple @@ -99,7 +99,8 @@ def __init__(self, raw_inputs: dict): ExistingBoilerInputs, SpaceHeatingLoadInputs, DomesticHotWaterLoadInputs, - CHPInputs + CHPInputs, + BoilerInputs ) self.pvnames = [] on_grid_required_object_names = [ diff --git a/job/views.py b/job/views.py index 942821cfc..6db23e80a 100644 --- a/job/views.py +++ b/job/views.py @@ -38,7 +38,7 @@ WindOutputs, ExistingBoilerInputs, GeneratorOutputs, ElectricTariffOutputs, ElectricUtilityOutputs,\ ElectricLoadOutputs, ExistingBoilerOutputs, DomesticHotWaterLoadInputs, SiteInputs, SiteOutputs, APIMeta,\ UserProvidedMeta, CHPInputs, CHPOutputs, CoolingLoadInputs, ExistingChillerInputs, ExistingChillerOutputs,\ - CoolingLoadOutputs, HeatingLoadOutputs + CoolingLoadOutputs, HeatingLoadOutputs, BoilerInputs, BoilerOutputs import os import requests import logging @@ -69,7 +69,7 @@ def help(request): d["CoolingLoad"] = CoolingLoadInputs.info_dict(CoolingLoadInputs) d["ExistingChiller"] = ExistingChillerInputs.info_dict(ExistingChillerInputs) d["ExistingBoiler"] = ExistingBoilerInputs.info_dict(ExistingBoilerInputs) - # d["Boiler"] = BoilerInputs.info_dict(BoilerInputs) + d["Boiler"] = BoilerInputs.info_dict(BoilerInputs) d["SpaceHeatingLoad"] = SpaceHeatingLoadInputs.info_dict(SpaceHeatingLoadInputs) d["DomesticHotWaterLoad"] = DomesticHotWaterLoadInputs.info_dict(DomesticHotWaterLoadInputs) d["Site"] = SiteInputs.info_dict(SiteInputs) @@ -109,7 +109,7 @@ def outputs(request): d["Generator"] = GeneratorOutputs.info_dict(GeneratorOutputs) d["ExistingChiller"] = ExistingChillerOutputs.info_dict(ExistingChillerOutputs) d["ExistingBoiler"] = ExistingBoilerOutputs.info_dict(ExistingBoilerOutputs) - # d["Boiler"] = BoilerOutputs.info_dict(BoilerOutputs) + d["Boiler"] = BoilerOutputs.info_dict(BoilerOutputs) d["HeatingLoad"] = HeatingLoadOutputs.info_dict(HeatingLoadOutputs) d["CoolingLoad"] = CoolingLoadOutputs.info_dict(CoolingLoadOutputs) d["CHP"] = CHPOutputs.info_dict(CHPOutputs) @@ -207,8 +207,8 @@ def results(request, run_uuid): try: r["inputs"]["ExistingBoiler"] = meta.ExistingBoilerInputs.dict except: pass - # try: r["inputs"]["Boiler"] = meta.BoilerInputs.dict - # except: pass + try: r["inputs"]["Boiler"] = meta.BoilerInputs.dict + except: pass try: r["inputs"]["SpaceHeatingLoad"] = meta.SpaceHeatingLoadInputs.dict except: pass @@ -255,8 +255,8 @@ def results(request, run_uuid): except: pass try: r["outputs"]["ExistingBoiler"] = meta.ExistingBoilerOutputs.dict except: pass - # try: r["outputs"]["Boiler"] = meta.BoilerOutputs.dict - # except: pass + try: r["outputs"]["Boiler"] = meta.BoilerOutputs.dict + except: pass try: r["outputs"]["CHP"] = meta.CHPOutputs.dict except: pass try: r["outputs"]["HeatingLoad"] = meta.HeatingLoadOutputs.dict From c46680fbc691a457598f449c5f185ebdd35c70a4 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 27 Feb 2023 11:16:10 -0500 Subject: [PATCH 02/92] add data models for boiler and steamturbine Tested that boiler and steamturbine inputs can make it to REopt.jl. --- .../0016_boilerinputs_boileroutputs.py | 52 --- ...ileroutputs_steamturbineinputs_and_more.py | 256 +++++++++++++ job/models.py | 341 +++++++++++++++++- job/src/process_results.py | 4 +- job/validators.py | 12 +- job/views.py | 38 +- 6 files changed, 630 insertions(+), 73 deletions(-) delete mode 100644 job/migrations/0016_boilerinputs_boileroutputs.py create mode 100644 job/migrations/0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py diff --git a/job/migrations/0016_boilerinputs_boileroutputs.py b/job/migrations/0016_boilerinputs_boileroutputs.py deleted file mode 100644 index f0c852315..000000000 --- a/job/migrations/0016_boilerinputs_boileroutputs.py +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by Django 4.0.7 on 2022-12-20 16:07 - -import django.contrib.postgres.fields -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import job.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('job', '0015_coolingloadinputs_coolingloadoutputs_and_more'), - ] - - operations = [ - migrations.CreateModel( - name='BoilerInputs', - fields=[ - ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerInputs', serialize=False, to='job.apimeta')), - ('min_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), - ('max_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), - ('efficiency', models.FloatField(default=0.8, help_text='New boiler system efficiency - conversion of fuel to usable heating thermal energy.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), - ('fuel_cost_per_mmbtu', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='Fuel cost in [$/MMBtu]', size=None)), - ('macrs_option_years', models.IntegerField(blank=True, choices=[(0, 'Zero'), (5, 'Five'), (7, 'Seven')], default=0, help_text='Duration over which accelerated depreciation will occur. Set to zero to disable', null=True)), - ('macrs_bonus_fraction', models.FloatField(blank=True, default=0.0, help_text='Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])), - ('installed_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=293000.0, help_text='Thermal power-based cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), - ('om_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=2930.0, help_text='Thermal power-based fixed O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), - ('om_cost_per_mmbtu', models.FloatField(blank=True, default=0.0, help_text='Thermal energy-based variable O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), - ('fuel_type', models.TextField(blank=True, choices=[('natural_gas', 'Natural Gas'), ('landfill_bio_gas', 'Landfill Bio Gas'), ('propane', 'Propane'), ('diesel_oil', 'Diesel Oil'), ('uranium', 'Uranium')], default='natural_gas', help_text='Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil, uranium', null=True)), - ('can_supply_steam_turbine', models.BooleanField(blank=True, default=True, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True)), - ], - bases=(job.models.BaseModel, models.Model), - ), - migrations.CreateModel( - name='BoilerOutputs', - fields=[ - ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerOutputs', serialize=False, to='job.apimeta')), - ('year_one_fuel_consumption_mmbtu', models.FloatField(blank=True, null=True)), - ('year_one_fuel_consumption_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), - ('lifecycle_fuel_cost', models.FloatField(blank=True, null=True)), - ('lifecycle_per_unit_prod_om_costs', models.FloatField(blank=True, null=True)), - ('lifecycle_fuel_cost_bau', models.FloatField(blank=True, null=True)), - ('year_one_thermal_production_mmbtu', models.FloatField(blank=True, null=True)), - ('year_one_fuel_cost', models.FloatField(blank=True, null=True)), - ('thermal_to_tes_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), - ('year_one_thermal_production_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), - ('year_one_thermal_to_load_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), - ], - bases=(job.models.BaseModel, models.Model), - ), - ] diff --git a/job/migrations/0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py b/job/migrations/0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py new file mode 100644 index 000000000..fb18621b5 --- /dev/null +++ b/job/migrations/0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py @@ -0,0 +1,256 @@ +# Generated by Django 4.0.7 on 2023-02-27 16:12 + +import django.contrib.postgres.fields +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import job.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0024_alter_electrictariffinputs_blended_annual_demand_rate'), + ] + + operations = [ + migrations.CreateModel( + name='BoilerInputs', + fields=[ + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerInputs', serialize=False, to='job.apimeta')), + ('min_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('max_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('efficiency', models.FloatField(default=0.8, help_text='New boiler system efficiency - conversion of fuel to usable heating thermal energy.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('fuel_cost_per_mmbtu', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='Fuel cost in [$/MMBtu]', size=None)), + ('macrs_option_years', models.IntegerField(blank=True, choices=[(0, 'Zero'), (5, 'Five'), (7, 'Seven')], default=0, help_text='Duration over which accelerated depreciation will occur. Set to zero to disable', null=True)), + ('macrs_bonus_fraction', models.FloatField(blank=True, default=0.0, help_text='Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])), + ('installed_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=293000.0, help_text='Thermal power-based cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('om_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=2930.0, help_text='Thermal power-based fixed O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('om_cost_per_mmbtu', models.FloatField(blank=True, default=0.0, help_text='Thermal energy-based variable O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('fuel_type', models.TextField(blank=True, choices=[('natural_gas', 'Natural Gas'), ('landfill_bio_gas', 'Landfill Bio Gas'), ('propane', 'Propane'), ('diesel_oil', 'Diesel Oil'), ('uranium', 'Uranium')], default='natural_gas', help_text='Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil, uranium', null=True)), + ('can_supply_steam_turbine', models.BooleanField(blank=True, default=True, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True)), + ], + bases=(job.models.BaseModel, models.Model), + ), + migrations.CreateModel( + name='BoilerOutputs', + fields=[ + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerOutputs', serialize=False, to='job.apimeta')), + ('fuel_consumption_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('thermal_to_load_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('year_one_fuel_cost_before_tax', models.FloatField(blank=True, null=True)), + ('thermal_to_steamturbine_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('thermal_production_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('thermal_to_storage_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('size_mmbtu_per_hour', models.FloatField(blank=True, null=True)), + ('annual_fuel_consumption_mmbtu', models.FloatField(blank=True, null=True)), + ('lifecycle_per_unit_prod_om_costs', models.FloatField(blank=True, null=True)), + ('lifecycle_fuel_cost_after_tax', models.FloatField(blank=True, null=True)), + ('annual_thermal_production_mmbtu', models.FloatField(blank=True, null=True)), + ], + bases=(job.models.BaseModel, models.Model), + ), + migrations.CreateModel( + name='SteamTurbineInputs', + fields=[ + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SteamTurbineInputs', serialize=False, to='job.apimeta')), + ('size_class', models.IntegerField(blank=True, choices=[(0, 'Zero'), (1, 'One'), (2, 'Two'), (4, 'Four')], help_text='Steam turbine size class for using appropriate default inputs', null=True)), + ('min_kw', models.FloatField(blank=True, default=0.0, help_text='Minimum steam turbine size constraint for optimization', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('max_kw', models.FloatField(blank=True, default=0.0, help_text='Maximum steam turbine size constraint for optimization', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('electric_produced_to_thermal_consumed_ratio', models.FloatField(blank=True, help_text='Simplified input as alternative to detailed calculations from inlet and outlet steam conditions', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('thermal_produced_to_thermal_consumed_ratio', models.FloatField(blank=True, help_text='Simplified input as alternative to detailed calculations from condensing outlet steam', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('is_condensing', models.BooleanField(blank=True, default=False, help_text='Steam turbine type, if it is a condensing turbine which produces no useful thermal (max electric output)')), + ('inlet_steam_pressure_psig', models.FloatField(blank=True, help_text='Inlet steam pressure to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(5000.0)])), + ('inlet_steam_temperature_degF', models.FloatField(blank=True, help_text='Inlet steam temperature to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1300.0)])), + ('inlet_steam_superheat_degF', models.FloatField(blank=True, help_text='Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(700.0)])), + ('outlet_steam_pressure_psig', models.FloatField(blank=True, help_text='Outlet steam pressure from the steam turbine (to the condenser or heat recovery unit)', null=True, validators=[django.core.validators.MinValueValidator(-14.7), django.core.validators.MaxValueValidator(1000.0)])), + ('outlet_steam_min_vapor_fraction', models.FloatField(blank=True, default=0.8, help_text='Minimum practical vapor fraction of steam at the exit of the steam turbine', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('isentropic_efficiency', models.FloatField(blank=True, help_text='Steam turbine isentropic efficiency - uses inlet T/P and outlet T/P/X to get power out', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('gearbox_generator_efficiency', models.FloatField(blank=True, help_text='Combined gearbox (if applicable) and electric motor/generator efficiency', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('net_to_gross_electric_ratio', models.FloatField(blank=True, help_text='Efficiency factor to account for auxiliary loads such as pumps, controls, lights, etc', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('installed_cost_per_kw', models.FloatField(blank=True, help_text='Installed steam turbine cost in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000.0)])), + ('om_cost_per_kw', models.FloatField(blank=True, help_text='Annual steam turbine fixed operations and maintenance costs in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(5000.0)])), + ('om_cost_per_kwh', models.FloatField(blank=True, help_text='Steam turbine per unit production (variable) operations and maintenance costs in $/kWh', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100.0)])), + ('can_net_meter', models.BooleanField(blank=True, default=False, help_text='True/False for if technology has option to participate in net metering agreement with utility. Note that a technology can only participate in either net metering or wholesale rates (not both).Note that if off-grid is true, net metering is always set to False.')), + ('can_wholesale', models.BooleanField(blank=True, default=False, help_text='True/False for if technology has option to export energy that is compensated at the wholesale_rate. Note that a technology can only participate in either net metering or wholesale rates (not both).Note that if off-grid is true, can_wholesale is always set to False.')), + ('can_export_beyond_nem_limit', models.BooleanField(blank=True, default=False, help_text='True/False for if technology can export energy beyond the annual site load (and be compensated for that energy at the export_rate_beyond_net_metering_limit).Note that if off-grid is true, can_export_beyond_nem_limit is always set to False.')), + ('can_curtail', models.BooleanField(blank=True, default=False, help_text='True/False for if technology has the ability to curtail energy production.')), + ('macrs_option_years', models.IntegerField(blank=True, choices=[(0, 'Zero'), (5, 'Five'), (7, 'Seven')], default=0, help_text='Duration over which accelerated depreciation will occur. Set to zero to disable')), + ('macrs_bonus_fraction', models.FloatField(blank=True, default=1.0, help_text='Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])), + ], + bases=(job.models.BaseModel, models.Model), + ), + migrations.CreateModel( + name='SteamTurbineOutputs', + fields=[ + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SteamTurbineOutputs', serialize=False, to='job.apimeta')), + ('size_kw', models.FloatField(blank=True, null=True)), + ('annual_thermal_consumption_mmbtu', models.FloatField(blank=True, null=True)), + ('annual_electric_production_kwh', models.FloatField(blank=True, null=True)), + ('annual_thermal_production_mmbtu', models.FloatField(blank=True, null=True)), + ('thermal_consumption_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('electric_production_series_kw', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('electric_to_grid_series_kw', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('electric_to_storage_series_kw', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('electric_to_load_series_kw', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('thermal_to_storage_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ('thermal_to_load_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), + ], + bases=(job.models.BaseModel, models.Model), + ), + migrations.AlterField( + model_name='chpinputs', + name='max_kw', + field=models.FloatField(blank=True, help_text='Maximum CHP size (in kWe) constraint for optimization. Set to zero to disable CHP', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='chpinputs', + name='min_allowable_kw', + field=models.FloatField(blank=True, help_text='Minimum nonzero CHP size (in kWe) (i.e. it is possible to select no CHP system)', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadinputs', + name='annual_tonhour', + field=models.FloatField(blank=True, help_text="Annual electric chiller thermal energy production, in [Ton-Hour],used to scale simulated default electric chiller load profile for the site's climate zone", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadinputs', + name='monthly_tonhour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text="Monthly site space cooling requirement in [Ton-Hour], used to scale simulated default building load profile for the site's climate zone", size=None), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='annual_calculated_tonhour', + field=models.FloatField(blank=True, default=0, help_text='Annual site total cooling load [tonhr]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='annual_electric_chiller_base_load_kwh', + field=models.FloatField(blank=True, default=0, help_text='Annual total base load drawn from chiller [kWh-electric]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='electric_chiller_base_load_series_kw', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total base load drawn from chiller [kW-electric]', size=None), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='load_series_ton', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total cooling load [ton]', size=None), + ), + migrations.AlterField( + model_name='domestichotwaterloadinputs', + name='annual_mmbtu', + field=models.FloatField(blank=True, help_text="Annual site DHW consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='domestichotwaterloadinputs', + name='monthly_mmbtu', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text="Monthly site DHW energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), + ), + migrations.AlterField( + model_name='electrictariffinputs', + name='export_rate_beyond_net_metering_limit', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='Price of electricity sold back to the grid above the site load, regardless of net metering. Can be a scalar value, which applies for all-time, or an array with time-sensitive values. If an array is input then it must have a length of 8760, 17520, or 35040. The inputed array values are up/down-sampled using mean values to match the Scenario time_steps_per_hour.', size=None), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_CO2_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_NOx_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_PM25_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_SO2_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='generatorinputs', + name='fuel_avail_gal', + field=models.FloatField(blank=True, help_text='On-site generator fuel available in gallons per year.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(10000000000.0)]), + ), + migrations.AlterField( + model_name='generatorinputs', + name='replace_cost_per_kw', + field=models.FloatField(blank=True, help_text='Per kW replacement cost for generator capacity. Replacement costs are considered tax deductible.', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(10000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_dhw_boiler_fuel_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site DHW boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_dhw_thermal_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site DHW load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_space_heating_boiler_fuel_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site space heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_space_heating_thermal_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site space heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_total_heating_boiler_fuel_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site total heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_total_heating_thermal_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site total heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='dhw_boiler_fuel_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='dhw_thermal_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='space_heating_boiler_fuel_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='space_heating_thermal_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='total_heating_boiler_fuel_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='total_heating_thermal_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='spaceheatingloadinputs', + name='annual_mmbtu', + field=models.FloatField(blank=True, help_text="Annual site space heating consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='spaceheatingloadinputs', + name='monthly_mmbtu', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text="Monthly site space heating energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), + ), + ] diff --git a/job/models.py b/job/models.py index 87c624a1f..ea2bea069 100644 --- a/job/models.py +++ b/job/models.py @@ -51,7 +51,7 @@ - description: use square brackets for units, eg. [dollars per kWh] - Output models need to have null=True, blank=True for cases when results are not generated """ -MAX_BIG_NUMBER = 1.0e8 +MAX_BIG_NUMBER = 1.0e9 MAX_INCENTIVE = 1.0e10 MAX_YEARS = 75 @@ -1391,7 +1391,6 @@ class ElectricTariffInputs(BaseModel, models.Model): export_rate_beyond_net_metering_limit = ArrayField( models.FloatField( blank=True, - default=0, validators=[ MinValueValidator(0) ] @@ -1468,6 +1467,7 @@ def clean(self): error_messages["required inputs"] = f"Must provide both {possible_set[0]} and {possible_set[1]}" self.wholesale_rate = scalar_to_vector(self.wholesale_rate) + self.export_rate_beyond_net_metering_limit = scalar_to_vector(self.export_rate_beyond_net_metering_limit) if len(self.coincident_peak_load_charge_per_kw) > 0: if len(self.coincident_peak_load_active_time_steps) != len(self.coincident_peak_load_charge_per_kw): @@ -4547,28 +4547,338 @@ class BoilerOutputs(BaseModel, models.Model): primary_key=True ) - year_one_fuel_consumption_mmbtu = models.FloatField(null=True, blank=True) + fuel_consumption_series_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) - year_one_fuel_consumption_mmbtu_per_hour = ArrayField( + thermal_to_load_series_mmbtu_per_hour = ArrayField( models.FloatField(null=True, blank=True), - default=list, + default = list, + ) + + year_one_fuel_cost_before_tax = models.FloatField( + null=True, blank=True + ) + + thermal_to_steamturbine_series_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + + thermal_production_series_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + + thermal_to_storage_series_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + + size_mmbtu_per_hour = models.FloatField(null=True, blank=True) + + annual_fuel_consumption_mmbtu = models.FloatField(null=True, blank=True) + + lifecycle_per_unit_prod_om_costs = models.FloatField( + null=True, blank=True + ) + + lifecycle_fuel_cost_after_tax = models.FloatField( + null=True, blank=True + ) + + annual_thermal_production_mmbtu = models.FloatField(null=True, blank=True) + + +class SteamTurbineInputs(BaseModel, models.Model): + + key = "SteamTurbine" + + meta = models.OneToOneField( + APIMeta, + on_delete=models.CASCADE, + related_name="SteamTurbineInputs", + primary_key=True + ) + + class SIZE_CLASS_LIST(models.IntegerChoices): + ZERO = 0, + ONE = 1 + TWO = 2 + FOUR = 4 + + # No default value provided in REO inputs or in REopt.jl input struct + size_class = models.IntegerField( + null=True, + choices=SIZE_CLASS_LIST.choices, + blank=True, + help_text="Steam turbine size class for using appropriate default inputs" + ) + + min_kw = models.FloatField( + default=0.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(1.0e9) + ], + blank=True, + help_text="Minimum steam turbine size constraint for optimization" + ) + max_kw = models.FloatField( + default=0.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(1.0e9) + ], + blank=True, + help_text="Maximum steam turbine size constraint for optimization" ) - lifecycle_fuel_cost = models.FloatField(null=True, blank=True) - lifecycle_per_unit_prod_om_costs = models.FloatField(null=True, blank=True) - lifecycle_fuel_cost_bau = models.FloatField(null=True, blank=True) - year_one_thermal_production_mmbtu = models.FloatField(null=True, blank=True) - year_one_fuel_cost = models.FloatField(null=True, blank=True) + electric_produced_to_thermal_consumed_ratio = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0) + ], + blank=True, + help_text="Simplified input as alternative to detailed calculations from inlet and outlet steam conditions" + ) - thermal_to_tes_series_mmbtu_per_hour = ArrayField( + thermal_produced_to_thermal_consumed_ratio = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0) + ], + blank=True, + help_text="Simplified input as alternative to detailed calculations from condensing outlet steam" + ) + + is_condensing = models.BooleanField( + blank=True, + default = False, + help_text="Steam turbine type, if it is a condensing turbine which produces no useful thermal (max electric output)" + ) + + inlet_steam_pressure_psig = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(5.0e3) + ], + blank=True, + help_text="Inlet steam pressure to the steam turbine" + ) + + inlet_steam_temperature_degF = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1300.0) + ], + blank=True, + help_text="Inlet steam temperature to the steam turbine" + ) + + inlet_steam_superheat_degF = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(700.0) + ], + blank=True, + help_text="Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine" + ) + + outlet_steam_pressure_psig = models.FloatField( + null=True, + validators=[ + MinValueValidator(-14.7), + MaxValueValidator(1.0e3) + ], + blank=True, + help_text="Outlet steam pressure from the steam turbine (to the condenser or heat recovery unit)" + ) + + outlet_steam_min_vapor_fraction = models.FloatField( + default=0.8, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0) + ], + blank=True, + help_text="Minimum practical vapor fraction of steam at the exit of the steam turbine" + ) + + isentropic_efficiency = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0) + ], + blank=True, + help_text="Steam turbine isentropic efficiency - uses inlet T/P and outlet T/P/X to get power out" + ) + + gearbox_generator_efficiency = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0) + ], + blank=True, + help_text="Combined gearbox (if applicable) and electric motor/generator efficiency" + ) + + net_to_gross_electric_ratio = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0) + ], + blank=True, + help_text="Efficiency factor to account for auxiliary loads such as pumps, controls, lights, etc" + ) + + installed_cost_per_kw = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0e5) + ], + blank=True, + help_text="Installed steam turbine cost in $/kW" + ) + + om_cost_per_kw = models.FloatField( + validators=[ + MinValueValidator(0.0), + MaxValueValidator(5.0e3) + ], + blank=True, + null=True, + help_text="Annual steam turbine fixed operations and maintenance costs in $/kW" + ) + + om_cost_per_kwh = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0e2) + ], + blank=True, + help_text="Steam turbine per unit production (variable) operations and maintenance costs in $/kWh" + ) + + can_net_meter = models.BooleanField( + blank=True, + default = False, + help_text=("True/False for if technology has option to participate in net metering agreement with utility. " + "Note that a technology can only participate in either net metering or wholesale rates (not both)." + "Note that if off-grid is true, net metering is always set to False.") + ) + + can_wholesale = models.BooleanField( + blank=True, + default = False, + help_text=("True/False for if technology has option to export energy that is compensated at the wholesale_rate. " + "Note that a technology can only participate in either net metering or wholesale rates (not both)." + "Note that if off-grid is true, can_wholesale is always set to False.") + ) + can_export_beyond_nem_limit = models.BooleanField( + blank=True, + default = False, + help_text=("True/False for if technology can export energy beyond the annual site load (and be compensated for " + "that energy at the export_rate_beyond_net_metering_limit)." + "Note that if off-grid is true, can_export_beyond_nem_limit is always set to False.") + ) + + can_curtail = models.BooleanField( + default=False, + blank=True, + help_text="True/False for if technology has the ability to curtail energy production." + ) + + macrs_option_years = models.IntegerField( + default=MACRS_YEARS_CHOICES.ZERO, + choices=MACRS_YEARS_CHOICES.choices, + blank=True, + help_text="Duration over which accelerated depreciation will occur. Set to zero to disable" + ) + + macrs_bonus_fraction = models.FloatField( + default=1.0, + validators=[ + MinValueValidator(0), + MaxValueValidator(1) + ], + blank=True, + help_text="Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation" + ) + + def clean(self): + pass + +class SteamTurbineOutputs(BaseModel, models.Model): + + key = "SteamTurbine" + + meta = models.OneToOneField( + APIMeta, + on_delete=models.CASCADE, + related_name="SteamTurbineOutputs", + primary_key=True + ) + + + size_kw = models.FloatField( + null=True, blank=True + ) + + annual_thermal_consumption_mmbtu = models.FloatField( + null=True, blank=True + ) + + annual_electric_production_kwh = models.FloatField( + null=True, blank=True + ) + + annual_thermal_production_mmbtu = models.FloatField( + null=True, blank=True + ) + + thermal_consumption_series_mmbtu_per_hour = ArrayField( models.FloatField(null=True, blank=True), default = list, ) - year_one_thermal_production_mmbtu_per_hour = ArrayField( + + electric_production_series_kw = ArrayField( models.FloatField(null=True, blank=True), default = list, ) - year_one_thermal_to_load_series_mmbtu_per_hour = ArrayField( + + electric_to_grid_series_kw = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + + electric_to_storage_series_kw = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + + electric_to_load_series_kw = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + + thermal_to_storage_series_mmbtu_per_hour = ArrayField( + models.FloatField(null=True, blank=True), + default = list, + ) + + thermal_to_load_series_mmbtu_per_hour = ArrayField( models.FloatField(null=True, blank=True), default = list, ) @@ -5519,7 +5829,10 @@ def filter_none_and_empty_array(d:dict): except: pass try: d["CHP"] = filter_none_and_empty_array(meta.CHPInputs.dict) - except: pass + except: pass + + try: d["SteamTurbine"] = filter_none_and_empty_array(meta.SteamTurbineInputs.dict) + except: pass return d diff --git a/job/src/process_results.py b/job/src/process_results.py index 6d3ee8c97..6c438cdca 100644 --- a/job/src/process_results.py +++ b/job/src/process_results.py @@ -30,7 +30,7 @@ from job.models import REoptjlMessageOutputs, FinancialOutputs, APIMeta, PVOutputs, ElectricStorageOutputs, ElectricTariffOutputs, SiteOutputs,\ ElectricUtilityOutputs, GeneratorOutputs, ElectricLoadOutputs, WindOutputs, FinancialInputs, ElectricUtilityInputs, ExistingBoilerOutputs,\ CHPInputs, CHPOutputs, ExistingChillerOutputs, CoolingLoadOutputs, HeatingLoadOutputs, HotThermalStorageOutputs, ColdThermalStorageOutputs, \ - BoilerOutputs + BoilerOutputs, SteamTurbineOutputs import logging log = logging.getLogger(__name__) import sys @@ -83,6 +83,8 @@ def process_results(results: dict, run_uuid: str) -> None: CoolingLoadOutputs.create(meta=meta, **results["CoolingLoad"]).save() if "CHP" in results.keys(): CHPOutputs.create(meta=meta, **results["CHP"]).save() + if "SteamTurbine" in results.keys(): + SteamTurbineOutputs.create(meta=meta, **results["SteamTurbine"]).save() # TODO process rest of results def update_inputs_in_database(inputs_to_update: dict, run_uuid: str) -> None: diff --git a/job/validators.py b/job/validators.py index 2f8f7f060..8da511ff3 100644 --- a/job/validators.py +++ b/job/validators.py @@ -31,7 +31,8 @@ import pandas as pd from job.models import MAX_BIG_NUMBER, APIMeta, ExistingBoilerInputs, UserProvidedMeta, SiteInputs, Settings, ElectricLoadInputs, ElectricTariffInputs, \ FinancialInputs, BaseModel, Message, ElectricUtilityInputs, PVInputs, ElectricStorageInputs, GeneratorInputs, WindInputs, SpaceHeatingLoadInputs, \ - DomesticHotWaterLoadInputs, CHPInputs, CoolingLoadInputs, ExistingChillerInputs, HotThermalStorageInputs, ColdThermalStorageInputs, BoilerInputs + DomesticHotWaterLoadInputs, CHPInputs, CoolingLoadInputs, ExistingChillerInputs, HotThermalStorageInputs, ColdThermalStorageInputs, BoilerInputs, \ + SteamTurbineInputs from django.core.exceptions import ValidationError from pyproj import Proj from typing import Tuple @@ -100,9 +101,10 @@ def __init__(self, raw_inputs: dict): SpaceHeatingLoadInputs, DomesticHotWaterLoadInputs, CHPInputs, - BoilerInputs + BoilerInputs, HotThermalStorageInputs, - ColdThermalStorageInputs + ColdThermalStorageInputs, + SteamTurbineInputs ) self.pvnames = [] on_grid_required_object_names = [ @@ -334,8 +336,8 @@ def update_pv_defaults_offgrid(self): if "ElectricTariff" in self.models.keys(): for key, time_series in zip( - ["ElectricTariff", "ElectricTariff"], - ["tou_energy_rates_per_kwh", "wholesale_rate"] + ["ElectricTariff", "ElectricTariff", "ElectricTariff"], + ["tou_energy_rates_per_kwh", "wholesale_rate", "export_rate_beyond_net_metering_limit"] ): self.clean_time_series(key, time_series) diff --git a/job/views.py b/job/views.py index 0edfa3bbe..d4ffe0250 100644 --- a/job/views.py +++ b/job/views.py @@ -40,7 +40,7 @@ ElectricLoadOutputs, ExistingBoilerOutputs, DomesticHotWaterLoadInputs, SiteInputs, SiteOutputs, APIMeta, \ UserProvidedMeta, CHPInputs, CHPOutputs, CoolingLoadInputs, ExistingChillerInputs, ExistingChillerOutputs,\ CoolingLoadOutputs, HeatingLoadOutputs, REoptjlMessageOutputs, HotThermalStorageInputs, HotThermalStorageOutputs,\ - ColdThermalStorageInputs, ColdThermalStorageOutputs, BoilerInputs, BoilerOutputs + ColdThermalStorageInputs, ColdThermalStorageOutputs, BoilerInputs, BoilerOutputs, SteamTurbineInputs, SteamTurbineOutputs import os import requests import logging @@ -78,6 +78,7 @@ def help(request): d["DomesticHotWaterLoad"] = DomesticHotWaterLoadInputs.info_dict(DomesticHotWaterLoadInputs) d["Site"] = SiteInputs.info_dict(SiteInputs) d["CHP"] = CHPInputs.info_dict(CHPInputs) + d["SteamTurbine"] = SteamTurbineInputs.info_dict(SteamTurbineInputs) return JsonResponse(d) except Exception as e: @@ -121,6 +122,7 @@ def outputs(request): d["CoolingLoad"] = CoolingLoadOutputs.info_dict(CoolingLoadOutputs) d["CHP"] = CHPOutputs.info_dict(CHPOutputs) d["Messages"] = REoptjlMessageOutputs.info_dict(REoptjlMessageOutputs) + d["SteamTurbine"] = SteamTurbineOutputs.info_dict(SteamTurbineOutputs) return JsonResponse(d) except Exception as e: @@ -233,6 +235,9 @@ def results(request, run_uuid): try: r["inputs"]["CHP"] = meta.CHPInputs.dict except: pass + try: r["inputs"]["SteamTurbine"] = meta.SteamTurbineInputs.dict + except: pass + try: r["outputs"] = dict() r["messages"] = dict() @@ -295,6 +300,8 @@ def results(request, run_uuid): except: pass try: r["outputs"]["CoolingLoad"] = meta.CoolingLoadOutputs.dict except: pass + try: r["outputs"]["SteamTurbine"] = meta.SteamTurbineOutputs.dict + except: pass for d in r["outputs"].values(): if isinstance(d, dict): @@ -319,7 +326,36 @@ def results(request, run_uuid): return JsonResponse(r) +# *********************************!!!!!!!!!!! +def steamturbine_defaults(request): + inputs = { + "existing_boiler_production_type": request.GET.get("existing_boiler_production_type"), + "avg_boiler_fuel_load_mmbtu_per_hour": request.GET.get("avg_boiler_fuel_load_mmbtu_per_hour"), + "prime_mover": request.GET.get("prime_mover"), + "size_class": request.GET.get("size_class"), + "boiler_efficiency": request.GET.get("boiler_efficiency") + } + try: + julia_host = os.environ.get('JULIA_HOST', "julia") + http_jl_response = requests.get("http://" + julia_host + ":8081/chp_defaults/", json=inputs) + response = JsonResponse( + http_jl_response.json() + ) + return response + + except ValueError as e: + return JsonResponse({"Error": str(e.args[0])}, status=500) + + except KeyError as e: + return JsonResponse({"Error. Missing": str(e.args[0])}, status=500) + except Exception: + exc_type, exc_value, exc_traceback = sys.exc_info() + debug_msg = "exc_type: {}; exc_value: {}; exc_traceback: {}".format(exc_type, exc_value.args[0], + tb.format_tb(exc_traceback)) + log.debug(debug_msg) + return JsonResponse({"Error": "Unexpected error in chp_defaults endpoint. Check log for more."}, status=500) + def chp_defaults(request): inputs = { "existing_boiler_production_type": request.GET.get("existing_boiler_production_type"), From 64ef8265f538dae8f5d368e6492cdca24ec863eb Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 27 Feb 2023 13:56:39 -0500 Subject: [PATCH 03/92] Revert max big number to what it was And update manifest --- job/models.py | 2 +- julia_src/Manifest.toml | 46 ++++++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/job/models.py b/job/models.py index ea2bea069..6d868f269 100644 --- a/job/models.py +++ b/job/models.py @@ -51,7 +51,7 @@ - description: use square brackets for units, eg. [dollars per kWh] - Output models need to have null=True, blank=True for cases when results are not generated """ -MAX_BIG_NUMBER = 1.0e9 +MAX_BIG_NUMBER = 1.0e8 MAX_INCENTIVE = 1.0e10 MAX_YEARS = 75 diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 043fc7793..99450bbdc 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.8.3" manifest_format = "2.0" -project_hash = "c2cdadb4ef175368e043d03d8dd75e25e020ef11" +project_hash = "90e66426e70d2bf97b8a3e99508fcb404743b11d" [[deps.AbstractFFTs]] deps = ["ChainRulesCore", "LinearAlgebra"] @@ -24,6 +24,7 @@ version = "0.9.3" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" [[deps.Arrow_jll]] deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Thrift_jll", "Zlib_jll", "boost_jll", "snappy_jll"] @@ -140,6 +141,7 @@ version = "4.5.0" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "0.5.2+0" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] @@ -212,8 +214,9 @@ uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.9.3" [[deps.Downloads]] -deps = ["ArgTools", "LibCURL", "NetworkOptions"] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -244,6 +247,9 @@ git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12" uuid = "48062228-2e41-5def-b9a4-89aafe57970f" version = "0.9.20" +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + [[deps.FixedPointNumbers]] deps = ["Statistics"] git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" @@ -295,6 +301,13 @@ git-tree-sha1 = "29e1ec25cfb6762f503a19495aec347acf867a9e" uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" version = "1.0.0" +[[deps.GhpGhx]] +git-tree-sha1 = "19a4afe42a79f22612478a87d9d938c6a5087af2" +repo-rev = "main" +repo-url = "https://github.com/NREL/GhpGhx.jl" +uuid = "7ce85f02-24a8-4d69-a3f0-14b5daa7d30c" +version = "0.1.0" + [[deps.Glob]] git-tree-sha1 = "4df9f7e06108728ebf00a0a11edee4b29a482bb2" uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" @@ -324,13 +337,6 @@ git-tree-sha1 = "4cc2bb72df6ff40b055295fdef6d92955f9dede8" uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" version = "1.12.2+2" -[[deps.GhpGhx]] -git-tree-sha1 = "19a4afe42a79f22612478a87d9d938c6a5087af2" -repo-rev = "main" -repo-url = "https://github.com/NREL/GhpGhx.jl" -uuid = "7ce85f02-24a8-4d69-a3f0-14b5daa7d30c" -version = "0.1.0" - [[deps.HTTP]] deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"] git-tree-sha1 = "0fa77022fe4b511826b39c894c90daf5fce3334a" @@ -442,10 +448,12 @@ version = "2.10.1+0" [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.3" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "7.84.0+0" [[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] @@ -460,6 +468,7 @@ version = "14.3.0+1" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.10.2+0" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" @@ -543,6 +552,7 @@ version = "1.1.7" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.0+0" [[deps.Memento]] deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"] @@ -561,6 +571,7 @@ version = "0.3.4" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2022.2.1" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] @@ -582,6 +593,7 @@ version = "400.902.5+1" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] @@ -592,6 +604,7 @@ version = "1.12.8" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.20+0" [[deps.OpenJpeg_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libtiff_jll", "LittleCMS_jll", "Pkg", "libpng_jll"] @@ -602,6 +615,7 @@ version = "2.4.0+0" [[deps.OpenLibm_jll]] deps = ["Artifacts", "Libdl"] uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+0" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -641,6 +655,7 @@ version = "2.5.2" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.8.0" [[deps.PolyhedralRelaxations]] deps = ["DataStructures", "ForwardDiff", "JuMP", "Logging", "LoggingExtras"] @@ -680,9 +695,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CoolProp", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "9c5a19161f6ae306782dc613a8d6c1360247a377" +git-tree-sha1 = "7c1ceee55c1460444167d80a485e785b759316b8" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.24.0" +version = "0.25.0" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -718,6 +733,7 @@ version = "2.0.8" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" [[deps.SQLite_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] @@ -782,6 +798,7 @@ uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.0" [[deps.TableTraits]] deps = ["IteratorInterfaceExtensions"] @@ -798,6 +815,7 @@ version = "1.10.0" [[deps.Tar]] deps = ["ArgTools", "SHA"] uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.1" [[deps.TensorCore]] deps = ["LinearAlgebra"] @@ -811,7 +829,7 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TestEnv]] deps = ["Pkg"] -git-tree-sha1 = "df6f1b5f13936504ba45088e13a62a6930cdabf7" +git-tree-sha1 = "e458e63fc410c725194e7705c0960bd3d910063a" uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b" version = "1.8.1" @@ -871,6 +889,7 @@ version = "0.15.5" [[deps.Zlib_jll]] deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.12+3" [[deps.Zstd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -887,6 +906,7 @@ version = "1.76.0+1" [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl", "OpenBLAS_jll"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.1.1+0" [[deps.libgeotiff_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Libtiff_jll", "PROJ_jll", "Pkg"] @@ -903,10 +923,12 @@ version = "1.6.38+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.48.0+0" [[deps.p7zip_jll]] deps = ["Artifacts", "Libdl"] uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+0" [[deps.snappy_jll]] deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Pkg", "Zlib_jll"] From 1395fc285484166dd3d641f15b2f4e8837f10e02 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 27 Feb 2023 23:37:31 -0500 Subject: [PATCH 04/92] Add steamturbine model and defaults endpoint Also add steamturbine test --- ...talled_cost_per_mmbtu_per_hour_and_more.py | 190 ++++++++++++++++++ job/models.py | 103 +++++----- job/test/test_http_endpoints.py | 37 ++++ job/urls.py | 1 + job/views.py | 11 +- julia_src/http.jl | 48 ++++- 6 files changed, 336 insertions(+), 54 deletions(-) create mode 100644 job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py diff --git a/job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py b/job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py new file mode 100644 index 000000000..c7fe894ab --- /dev/null +++ b/job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py @@ -0,0 +1,190 @@ +# Generated by Django 4.0.7 on 2023-02-28 03:34 + +import django.contrib.postgres.fields +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0025_boilerinputs_boileroutputs_steamturbineinputs_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='boilerinputs', + name='installed_cost_per_mmbtu_per_hour', + field=models.FloatField(blank=True, default=293000.0, help_text='Thermal power-based cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='boilerinputs', + name='max_mmbtu_per_hour', + field=models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='boilerinputs', + name='min_mmbtu_per_hour', + field=models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='boilerinputs', + name='om_cost_per_mmbtu', + field=models.FloatField(blank=True, default=0.0, help_text='Thermal energy-based variable O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='boilerinputs', + name='om_cost_per_mmbtu_per_hour', + field=models.FloatField(blank=True, default=2930.0, help_text='Thermal power-based fixed O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='chpinputs', + name='max_kw', + field=models.FloatField(blank=True, help_text='Maximum CHP size (in kWe) constraint for optimization. Set to zero to disable CHP', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='chpinputs', + name='min_allowable_kw', + field=models.FloatField(blank=True, help_text='Minimum nonzero CHP size (in kWe) (i.e. it is possible to select no CHP system)', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadinputs', + name='annual_tonhour', + field=models.FloatField(blank=True, help_text="Annual electric chiller thermal energy production, in [Ton-Hour],used to scale simulated default electric chiller load profile for the site's climate zone", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadinputs', + name='monthly_tonhour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text="Monthly site space cooling requirement in [Ton-Hour], used to scale simulated default building load profile for the site's climate zone", size=None), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='annual_calculated_tonhour', + field=models.FloatField(blank=True, default=0, help_text='Annual site total cooling load [tonhr]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='annual_electric_chiller_base_load_kwh', + field=models.FloatField(blank=True, default=0, help_text='Annual total base load drawn from chiller [kWh-electric]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='electric_chiller_base_load_series_kw', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total base load drawn from chiller [kW-electric]', size=None), + ), + migrations.AlterField( + model_name='coolingloadoutputs', + name='load_series_ton', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total cooling load [ton]', size=None), + ), + migrations.AlterField( + model_name='domestichotwaterloadinputs', + name='annual_mmbtu', + field=models.FloatField(blank=True, help_text="Annual site DHW consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='domestichotwaterloadinputs', + name='monthly_mmbtu', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text="Monthly site DHW energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_CO2_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_NOx_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_PM25_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='existingboilerinputs', + name='emissions_factor_lb_SO2_per_mmbtu', + field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='generatorinputs', + name='fuel_avail_gal', + field=models.FloatField(blank=True, help_text='On-site generator fuel available in gallons per year.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='generatorinputs', + name='replace_cost_per_kw', + field=models.FloatField(blank=True, help_text='Per kW replacement cost for generator capacity. Replacement costs are considered tax deductible.', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_dhw_boiler_fuel_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site DHW boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_dhw_thermal_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site DHW load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_space_heating_boiler_fuel_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site space heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_space_heating_thermal_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site space heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_total_heating_boiler_fuel_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site total heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='annual_calculated_total_heating_thermal_load_mmbtu', + field=models.FloatField(blank=True, default=0, help_text='Annual site total heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='dhw_boiler_fuel_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='dhw_thermal_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='space_heating_boiler_fuel_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='space_heating_thermal_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='total_heating_boiler_fuel_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='heatingloadoutputs', + name='total_heating_thermal_load_series_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), + ), + migrations.AlterField( + model_name='spaceheatingloadinputs', + name='annual_mmbtu', + field=models.FloatField(blank=True, help_text="Annual site space heating consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100000000.0)]), + ), + migrations.AlterField( + model_name='spaceheatingloadinputs', + name='monthly_mmbtu', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text="Monthly site space heating energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), + ), + ] diff --git a/job/models.py b/job/models.py index 6d868f269..7d9e4c4ac 100644 --- a/job/models.py +++ b/job/models.py @@ -4608,14 +4608,6 @@ class SIZE_CLASS_LIST(models.IntegerChoices): TWO = 2 FOUR = 4 - # No default value provided in REO inputs or in REopt.jl input struct - size_class = models.IntegerField( - null=True, - choices=SIZE_CLASS_LIST.choices, - blank=True, - help_text="Steam turbine size class for using appropriate default inputs" - ) - min_kw = models.FloatField( default=0.0, validators=[ @@ -4635,30 +4627,32 @@ class SIZE_CLASS_LIST(models.IntegerChoices): help_text="Maximum steam turbine size constraint for optimization" ) - electric_produced_to_thermal_consumed_ratio = models.FloatField( + # default values for these fields is determined via steamturbine_defaults returned from REoptInputs() call in http.jl + size_class = models.IntegerField( + null=True, + choices=SIZE_CLASS_LIST.choices, + blank=True, + help_text="Steam turbine size class for using appropriate default inputs" + ) + + gearbox_generator_efficiency = models.FloatField( null=True, validators=[ MinValueValidator(0.0), MaxValueValidator(1.0) ], blank=True, - help_text="Simplified input as alternative to detailed calculations from inlet and outlet steam conditions" + help_text="Combined gearbox (if applicable) and electric motor/generator efficiency" ) - - thermal_produced_to_thermal_consumed_ratio = models.FloatField( + + isentropic_efficiency = models.FloatField( null=True, validators=[ MinValueValidator(0.0), MaxValueValidator(1.0) ], blank=True, - help_text="Simplified input as alternative to detailed calculations from condensing outlet steam" - ) - - is_condensing = models.BooleanField( - blank=True, - default = False, - help_text="Steam turbine type, if it is a condensing turbine which produces no useful thermal (max electric output)" + help_text="Combined gearbox (if applicable) and electric motor/generator efficiency" ) inlet_steam_pressure_psig = models.FloatField( @@ -4681,14 +4675,24 @@ class SIZE_CLASS_LIST(models.IntegerChoices): help_text="Inlet steam temperature to the steam turbine" ) - inlet_steam_superheat_degF = models.FloatField( + installed_cost_per_kw = models.FloatField( null=True, validators=[ MinValueValidator(0.0), - MaxValueValidator(700.0) + MaxValueValidator(1.0e5) ], blank=True, - help_text="Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine" + help_text="Installed steam turbine cost in $/kW" + ) + + om_cost_per_kwh = models.FloatField( + null=True, + validators=[ + MinValueValidator(0.0), + MaxValueValidator(1.0e2) + ], + blank=True, + help_text="Steam turbine per unit production (variable) operations and maintenance costs in $/kWh" ) outlet_steam_pressure_psig = models.FloatField( @@ -4701,74 +4705,83 @@ class SIZE_CLASS_LIST(models.IntegerChoices): help_text="Outlet steam pressure from the steam turbine (to the condenser or heat recovery unit)" ) - outlet_steam_min_vapor_fraction = models.FloatField( - default=0.8, + net_to_gross_electric_ratio = models.FloatField( + null=True, validators=[ MinValueValidator(0.0), MaxValueValidator(1.0) ], blank=True, - help_text="Minimum practical vapor fraction of steam at the exit of the steam turbine" + help_text="Efficiency factor to account for auxiliary loads such as pumps, controls, lights, etc" ) - isentropic_efficiency = models.FloatField( + # no prime mover field here? no chp_size_based_on_avg_heating_load_kw here? + + # Other input fields + electric_produced_to_thermal_consumed_ratio = models.FloatField( null=True, validators=[ MinValueValidator(0.0), MaxValueValidator(1.0) ], blank=True, - help_text="Steam turbine isentropic efficiency - uses inlet T/P and outlet T/P/X to get power out" + help_text="Simplified input as alternative to detailed calculations from inlet and outlet steam conditions" ) - - gearbox_generator_efficiency = models.FloatField( + + thermal_produced_to_thermal_consumed_ratio = models.FloatField( null=True, validators=[ MinValueValidator(0.0), MaxValueValidator(1.0) ], blank=True, - help_text="Combined gearbox (if applicable) and electric motor/generator efficiency" + help_text="Simplified input as alternative to detailed calculations from condensing outlet steam" ) - net_to_gross_electric_ratio = models.FloatField( + is_condensing = models.BooleanField( + blank=True, + default = False, + help_text="Steam turbine type, if it is a condensing turbine which produces no useful thermal (max electric output)" + ) + + inlet_steam_superheat_degF = models.FloatField( null=True, validators=[ MinValueValidator(0.0), - MaxValueValidator(1.0) + MaxValueValidator(700.0) ], blank=True, - help_text="Efficiency factor to account for auxiliary loads such as pumps, controls, lights, etc" + help_text="Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine" ) - installed_cost_per_kw = models.FloatField( - null=True, + outlet_steam_min_vapor_fraction = models.FloatField( + default=0.8, validators=[ MinValueValidator(0.0), - MaxValueValidator(1.0e5) + MaxValueValidator(1.0) ], blank=True, - help_text="Installed steam turbine cost in $/kW" + help_text="Minimum practical vapor fraction of steam at the exit of the steam turbine" ) - om_cost_per_kw = models.FloatField( + isentropic_efficiency = models.FloatField( + null=True, validators=[ MinValueValidator(0.0), - MaxValueValidator(5.0e3) + MaxValueValidator(1.0) ], blank=True, - null=True, - help_text="Annual steam turbine fixed operations and maintenance costs in $/kW" + help_text="Steam turbine isentropic efficiency - uses inlet T/P and outlet T/P/X to get power out" ) - om_cost_per_kwh = models.FloatField( - null=True, + om_cost_per_kw = models.FloatField( validators=[ MinValueValidator(0.0), - MaxValueValidator(1.0e2) + MaxValueValidator(5.0e3) ], blank=True, - help_text="Steam turbine per unit production (variable) operations and maintenance costs in $/kWh" + null=True, + help_text="Annual steam turbine fixed operations and maintenance costs in $/kW" ) can_net_meter = models.BooleanField( diff --git a/job/test/test_http_endpoints.py b/job/test/test_http_endpoints.py index d5abcfbec..4a7619d16 100644 --- a/job/test/test_http_endpoints.py +++ b/job/test/test_http_endpoints.py @@ -45,6 +45,43 @@ def test_chp_defaults(self): resp = self.api_client.get(f'/v2/chp_defaults', data=inputs_v2) v2_response = json.loads(resp.content) self.assertEqual(http_response["size_class"], v2_response["size_class"]+1) + + def test_steamturbine_defaults(self): + + inputs = { + "avg_boiler_fuel_load_mmbtu_per_hour": 28.0 + } + + # Direct call of the http.jl endpoint /steamturbine_defaults + julia_host = os.environ.get('JULIA_HOST', "julia") + response = requests.get("http://" + julia_host + ":8081/steamturbine_defaults/", json=inputs) + http_response = response.json() + + # Call to the django view endpoint /steamturbine_defaults which calls the http.jl endpoint + resp = self.api_client.get(f'/dev/steamturbine_defaults', data=inputs) + view_response = json.loads(resp.content) + + mismatch = [] + for k, v in http_response["default_inputs"].items(): + if v != view_response["default_inputs"][k]: + mismatch.append(k) + + self.assertEqual(mismatch, []) + + # Check the endpoint logic with the expected selection + self.assertEqual(http_response["prime_mover"], "steam_turbine") + self.assertEqual(http_response["size_class"], 2) + self.assertGreater(http_response["chp_size_based_on_avg_heating_load_kw"], 574.419) + + # Check that size_class logic is the same, but we shifted it to 1-indexed instead of 0-indexed + # Modify input names for v2 + # inputs_v2 = { + # "existing_boiler_production_type_steam_or_hw": inputs["existing_boiler_production_type"], + # "avg_boiler_fuel_load_mmbtu_per_hr": inputs["avg_boiler_fuel_load_mmbtu_per_hour"] + # } + # resp = self.api_client.get(f'/v2/chp_defaults', data=inputs_v2) + # v2_response = json.loads(resp.content) + # self.assertEqual(http_response["size_class"], v2_response["size_class"]+1) def test_simulated_load(self): diff --git a/job/urls.py b/job/urls.py index 7964523c9..4895ff5d1 100644 --- a/job/urls.py +++ b/job/urls.py @@ -37,6 +37,7 @@ re_path(r'^job/inputs/?$', views.inputs), re_path(r'^job/outputs/?$', views.outputs), re_path(r'^chp_defaults/?$', views.chp_defaults), + re_path(r'^steamturbine_defaults/?$', views.steamturbine_defaults), re_path(r'^simulated_load/?$', views.simulated_load), re_path(r'^invalid_urdb/?$', reoviews.invalid_urdb), diff --git a/job/views.py b/job/views.py index d4ffe0250..d05b5f940 100644 --- a/job/views.py +++ b/job/views.py @@ -326,18 +326,13 @@ def results(request, run_uuid): return JsonResponse(r) -# *********************************!!!!!!!!!!! def steamturbine_defaults(request): inputs = { - "existing_boiler_production_type": request.GET.get("existing_boiler_production_type"), - "avg_boiler_fuel_load_mmbtu_per_hour": request.GET.get("avg_boiler_fuel_load_mmbtu_per_hour"), - "prime_mover": request.GET.get("prime_mover"), - "size_class": request.GET.get("size_class"), - "boiler_efficiency": request.GET.get("boiler_efficiency") + "avg_boiler_fuel_load_mmbtu_per_hour": request.GET.get("avg_boiler_fuel_load_mmbtu_per_hour") } try: julia_host = os.environ.get('JULIA_HOST', "julia") - http_jl_response = requests.get("http://" + julia_host + ":8081/chp_defaults/", json=inputs) + http_jl_response = requests.get("http://" + julia_host + ":8081/steamturbine_defaults/", json=inputs) response = JsonResponse( http_jl_response.json() ) @@ -354,7 +349,7 @@ def steamturbine_defaults(request): debug_msg = "exc_type: {}; exc_value: {}; exc_traceback: {}".format(exc_type, exc_value.args[0], tb.format_tb(exc_traceback)) log.debug(debug_msg) - return JsonResponse({"Error": "Unexpected error in chp_defaults endpoint. Check log for more."}, status=500) + return JsonResponse({"Error": "Unexpected error in steamturbine_defaults endpoint. Check log for more."}, status=500) def chp_defaults(request): inputs = { diff --git a/julia_src/http.jl b/julia_src/http.jl index 802dbca17..b1bf66afd 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -101,10 +101,21 @@ function reopt(req::HTTP.Request) else chp_dict = Dict() end + if haskey(d, "SteamTurbine") # no prime mover or chp_size_based_on_avg_heating_load_kw? + inputs_with_defaults_from_steamturbine = [ + :size_class, :gearbox_generator_efficiency, :isentropic_efficiency, + :inlet_steam_pressure_psig, :inlet_steam_temperature_degF, :installed_cost_per_kw, :om_cost_per_kwh, + :outlet_steam_pressure_psig, :net_to_gross_electric_ratio + ] + steamturbine_dict = Dict(key=>getfield(model_inputs.s.steam_turbine, key) for key in inputs_with_defaults_from_steamturbine) + else + steamturbine_dict = Dict() + end inputs_with_defaults_set_in_julia = Dict( "Financial" => Dict(key=>getfield(model_inputs.s.financial, key) for key in inputs_with_defaults_from_easiur), "ElectricUtility" => Dict(key=>getfield(model_inputs.s.electric_utility, key) for key in inputs_with_defaults_from_avert), - "CHP" => chp_dict + "CHP" => chp_dict, + "SteamTurbine" => steamturbine_dict ) catch e @error "Something went wrong in REopt optimization!" exception=(e, catch_backtrace()) @@ -198,6 +209,40 @@ function chp_defaults(req::HTTP.Request) end end +# Should this accept all inputs provided in `get_steam_turbine_defaults_size_class` docstring in REopt.jl? +function steamturbine_defaults(req::HTTP.Request) + d = JSON.parse(String(req.body)) + keys = ["avg_boiler_fuel_load_mmbtu_per_hour"] + # Process .json inputs and convert to correct type if needed + for k in keys + if !haskey(d, k) + d[k] = nothing + elseif !isnothing(d[k]) + if k in ["avg_boiler_fuel_load_mmbtu_per_hour"] && typeof(d[k]) == String + d[k] = parse(Float64, d[k]) + end + end + end + + @info "Getting SteamTurbine defaults..." + data = Dict() + error_response = Dict() + try + data = reoptjl.get_steam_turbine_defaults_size_class(;avg_boiler_fuel_load_mmbtu_per_hour=d["avg_boiler_fuel_load_mmbtu_per_hour"]) + catch e + @error "Something went wrong in the steamturbine_defaults" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info "SteamTurbine defaults determined." + response = data + return HTTP.Response(200, JSON.json(response)) + else + @info "An error occured in the steamturbine_defaults endpoint" + return HTTP.Response(500, JSON.json(error_response)) + end +end + function simulated_load(req::HTTP.Request) d = JSON.parse(String(req.body)) @@ -242,6 +287,7 @@ HTTP.@register(ROUTER, "POST", "/job", job) HTTP.@register(ROUTER, "POST", "/reopt", reopt) HTTP.@register(ROUTER, "POST", "/ghpghx", ghpghx) HTTP.@register(ROUTER, "GET", "/chp_defaults", chp_defaults) +HTTP.@register(ROUTER, "GET", "/steamturbine_defaults", steamturbine_defaults) HTTP.@register(ROUTER, "GET", "/simulated_load", simulated_load) HTTP.@register(ROUTER, "GET", "/health", health) HTTP.serve(ROUTER, "0.0.0.0", 8081, reuseaddr=true) From 06371a3c1b4fea169c7b0f0ad1135081ae86d3be Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Tue, 28 Feb 2023 15:42:37 -0500 Subject: [PATCH 05/92] Try to add tests for steamturbine Attempt 1 --- job/models.py | 4 +- .../posts/steamturbine_defaults_post.json | 64 +++++++++++++++++++ job/test/test_http_endpoints.py | 10 --- job/test/test_job_endpoint.py | 32 +++++++++- job/views.py | 3 +- julia_src/http.jl | 13 +++- 6 files changed, 108 insertions(+), 18 deletions(-) create mode 100644 job/test/posts/steamturbine_defaults_post.json diff --git a/job/models.py b/job/models.py index 7d9e4c4ac..c68d6ceda 100644 --- a/job/models.py +++ b/job/models.py @@ -4627,7 +4627,7 @@ class SIZE_CLASS_LIST(models.IntegerChoices): help_text="Maximum steam turbine size constraint for optimization" ) - # default values for these fields is determined via steamturbine_defaults returned from REoptInputs() call in http.jl + ## default values for these fields is determined via steamturbine_defaults returned from REoptInputs() call in http.jl size_class = models.IntegerField( null=True, choices=SIZE_CLASS_LIST.choices, @@ -4715,8 +4715,6 @@ class SIZE_CLASS_LIST(models.IntegerChoices): help_text="Efficiency factor to account for auxiliary loads such as pumps, controls, lights, etc" ) - # no prime mover field here? no chp_size_based_on_avg_heating_load_kw here? - # Other input fields electric_produced_to_thermal_consumed_ratio = models.FloatField( null=True, diff --git a/job/test/posts/steamturbine_defaults_post.json b/job/test/posts/steamturbine_defaults_post.json new file mode 100644 index 000000000..ff5617bfd --- /dev/null +++ b/job/test/posts/steamturbine_defaults_post.json @@ -0,0 +1,64 @@ +{ + "ElectricStorage": { + "max_kw": 0.0, + "max_kwh": 0.0 + }, + "DomesticHotWaterLoad": { + "annual_mmbtu": 67140.53099999999, + "doe_reference_name": "Hospital" + }, + "ElectricTariff": { + "urdb_label": "5e1676e95457a3f87673e3b0" + }, + "Site": { + "latitude": 37.78, + "longitude": -122.45 + }, + "ElectricLoad": { + "annual_kwh": 3.876408500000039e7, + "doe_reference_name": "Hospital" + }, + "PV": { + "max_kw": 0.0 + }, + "Financial": { + "offtaker_tax_rate_fraction": 0.26, + "analysis_years": 25, + "om_cost_escalation_rate_fraction": 0.025, + "elec_cost_escalation_rate_fraction": 0.023, + "owner_discount_rate_fraction": 0.083, + "owner_tax_rate_fraction": 0.26, + "existing_boiler_fuel_cost_escalation_rate_fraction": 0.034, + "offtaker_discount_rate_fraction": 0.083, + "third_party_ownership": false + }, + "SpaceHeatingLoad": { + "annual_mmbtu": 1.15709155e6, + "doe_reference_name": "Hospital" + }, + "SteamTurbine": { + "inlet_steam_temperature_degF": 575.0, + "outlet_steam_pressure_psig": 150.0, + "om_cost_per_kwh": 0.009, + "net_to_gross_electric_ratio": 0.9, + "min_kw": 0, + "gearbox_generator_efficiency": 0.94, + "is_condensing": false, + "inlet_steam_pressure_psig": 600.0, + "outlet_steam_min_vapor_fraction": 0.8, + "max_kw": 20000.0, + "can_wholesale": false, + "installed_cost_per_kw": 682.0, + "can_curtail": false, + "isentropic_efficiency": 0.612, + "om_cost_per_kw": 0.0 + }, + "ExistingBoiler": { + "fuel_cost_per_mmbtu": 10.0, + "fuel_type": "natural_gas", + "efficiency": 0.8, + "can_supply_steam_turbine": true, + "max_thermal_factor_on_peak_load": 1.25, + "production_type": "steam" + } +} \ No newline at end of file diff --git a/job/test/test_http_endpoints.py b/job/test/test_http_endpoints.py index 4a7619d16..320451308 100644 --- a/job/test/test_http_endpoints.py +++ b/job/test/test_http_endpoints.py @@ -73,16 +73,6 @@ def test_steamturbine_defaults(self): self.assertEqual(http_response["size_class"], 2) self.assertGreater(http_response["chp_size_based_on_avg_heating_load_kw"], 574.419) - # Check that size_class logic is the same, but we shifted it to 1-indexed instead of 0-indexed - # Modify input names for v2 - # inputs_v2 = { - # "existing_boiler_production_type_steam_or_hw": inputs["existing_boiler_production_type"], - # "avg_boiler_fuel_load_mmbtu_per_hr": inputs["avg_boiler_fuel_load_mmbtu_per_hour"] - # } - # resp = self.api_client.get(f'/v2/chp_defaults', data=inputs_v2) - # v2_response = json.loads(resp.content) - # self.assertEqual(http_response["size_class"], v2_response["size_class"]+1) - def test_simulated_load(self): # Test heating load because REopt.jl separates SpaceHeating and DHW, so had to aggregate for this endpoint diff --git a/job/test/test_job_endpoint.py b/job/test/test_job_endpoint.py index 32e373b3e..886c08051 100644 --- a/job/test/test_job_endpoint.py +++ b/job/test/test_job_endpoint.py @@ -240,4 +240,34 @@ def test_superset_input_fields(self): results = r["outputs"] self.assertAlmostEqual(results["Financial"]["npv"], 165.21, places=-2) - assert(resp.status_code==200) + assert(resp.status_code==200) + + def test_steamturbine_defaults_from_julia(self): + # Test that the inputs_with_defaults_set_in_julia feature worked for SteamTurbine, consistent with /steamturbine_defaults + post_file = os.path.join('job', 'test', 'posts', 'steamturbine_defaults_post.json') + post = json.load(open(post_file, 'r')) + resp = self.api_client.post('/dev/job/', format='json', data=post) + self.assertHttpCreated(resp) + r = json.loads(resp.content) + run_uuid = r.get('run_uuid') + + resp = self.api_client.get(f'/dev/job/{run_uuid}/results') + r = json.loads(resp.content) + + inputs_steamturbine = r["inputs"]["SteamTurbine"] + + avg_fuel_load = (post["SpaceHeatingLoad"]["annual_mmbtu"] + + post["DomesticHotWaterLoad"]["annual_mmbtu"]) / 8760.0 + inputs_steamturbine_defaults = { + "avg_boiler_fuel_load_mmbtu_per_hour": avg_fuel_load + } + + # Call to the django view endpoint /steamturbine_defaults which calls the http.jl endpoint + resp = self.api_client.get(f'/dev/steamturbine_defaults', data=inputs_steamturbine_defaults) + view_response = json.loads(resp.content) + + for key in view_response["default_inputs"].keys(): + if post["SteamTurbine"].get(key) is None: # Check that default got assigned consistent with /steamturbine_defaults + self.assertEquals(inputs_steamturbine[key], view_response["default_inputs"][key]) + else: # Make sure we didn't overwrite user-input + self.assertEquals(inputs_steamturbine[key], post["SteamTurbine"][key]) \ No newline at end of file diff --git a/job/views.py b/job/views.py index d05b5f940..c75c4e785 100644 --- a/job/views.py +++ b/job/views.py @@ -328,7 +328,8 @@ def results(request, run_uuid): def steamturbine_defaults(request): inputs = { - "avg_boiler_fuel_load_mmbtu_per_hour": request.GET.get("avg_boiler_fuel_load_mmbtu_per_hour") + "avg_boiler_fuel_load_mmbtu_per_hour": request.GET.get("avg_boiler_fuel_load_mmbtu_per_hour"), + "size_class": request.GET.get("size_class") } try: julia_host = os.environ.get('JULIA_HOST', "julia") diff --git a/julia_src/http.jl b/julia_src/http.jl index b1bf66afd..d6835a6bf 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -101,7 +101,7 @@ function reopt(req::HTTP.Request) else chp_dict = Dict() end - if haskey(d, "SteamTurbine") # no prime mover or chp_size_based_on_avg_heating_load_kw? + if haskey(d, "SteamTurbine") inputs_with_defaults_from_steamturbine = [ :size_class, :gearbox_generator_efficiency, :isentropic_efficiency, :inlet_steam_pressure_psig, :inlet_steam_temperature_degF, :installed_cost_per_kw, :om_cost_per_kwh, @@ -185,6 +185,7 @@ function chp_defaults(req::HTTP.Request) end end end + println(d) @info "Getting CHP defaults..." data = Dict() @@ -212,7 +213,9 @@ end # Should this accept all inputs provided in `get_steam_turbine_defaults_size_class` docstring in REopt.jl? function steamturbine_defaults(req::HTTP.Request) d = JSON.parse(String(req.body)) - keys = ["avg_boiler_fuel_load_mmbtu_per_hour"] + keys = ["avg_boiler_fuel_load_mmbtu_per_hour", + "size_class" + ] # Process .json inputs and convert to correct type if needed for k in keys if !haskey(d, k) @@ -220,6 +223,8 @@ function steamturbine_defaults(req::HTTP.Request) elseif !isnothing(d[k]) if k in ["avg_boiler_fuel_load_mmbtu_per_hour"] && typeof(d[k]) == String d[k] = parse(Float64, d[k]) + elseif k == "size_class" && typeof(d[k]) == String + d[k] = parse(Int64, d[k]) end end end @@ -228,7 +233,9 @@ function steamturbine_defaults(req::HTTP.Request) data = Dict() error_response = Dict() try - data = reoptjl.get_steam_turbine_defaults_size_class(;avg_boiler_fuel_load_mmbtu_per_hour=d["avg_boiler_fuel_load_mmbtu_per_hour"]) + data = reoptjl.get_steam_turbine_defaults_size_class(;avg_boiler_fuel_load_mmbtu_per_hour=d["avg_boiler_fuel_load_mmbtu_per_hour"], + size_class=d["size_class"] + ) catch e @error "Something went wrong in the steamturbine_defaults" exception=(e, catch_backtrace()) error_response["error"] = sprint(showerror, e) From 040411ce1a9c428bd27a83973e532cda18640b06 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Sat, 4 Mar 2023 13:23:01 -0500 Subject: [PATCH 06/92] debug and add tests --- job/test/posts/boiler_test.json | 60 +++++++ .../posts/steamturbine_defaults_post.json | 36 +--- job/test/test_validator.py | 18 ++ julia_src/Manifest.toml | 155 +++++++++--------- julia_src/http.jl | 3 +- 5 files changed, 159 insertions(+), 113 deletions(-) create mode 100644 job/test/posts/boiler_test.json diff --git a/job/test/posts/boiler_test.json b/job/test/posts/boiler_test.json new file mode 100644 index 000000000..acebd2016 --- /dev/null +++ b/job/test/posts/boiler_test.json @@ -0,0 +1,60 @@ +{ + "DomesticHotWaterLoad": { + "annual_mmbtu": 4380.0, + "doe_reference_name": "FlatLoad" + }, + "ElectricTariff": { + "urdb_label": "5e1676e95457a3f87673e3b0", + "wholesale_rate": 0.04 + }, + "Site": { + "latitude": 37.78, + "longitude": -122.45 + }, + "ElectricLoad": { + "annual_kwh": 8.76e6, + "doe_reference_name": "FlatLoad" + }, + "Boiler": { + "fuel_cost_per_mmbtu": [ + 5, + 10, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5 + ], + "max_mmbtu_per_hour": 1.0e9, + "om_cost_per_mmbtu_per_hour": 0.0, + "installed_cost_per_mmbtu_per_hour": 0.001 + }, + "SpaceHeatingLoad": { + "annual_mmbtu": 4380.0, + "doe_reference_name": "FlatLoad" + }, + "ExistingBoiler": { + "fuel_cost_per_mmbtu": [ + 10, + 2, + 10, + 10, + 10, + 10, + 10, + 10, + 10, + 10, + 10, + 10 + ], + "fuel_type": "natural_gas", + "efficiency": 0.8, + "production_type": "steam" + } +} \ No newline at end of file diff --git a/job/test/posts/steamturbine_defaults_post.json b/job/test/posts/steamturbine_defaults_post.json index ff5617bfd..ea7b2d7d9 100644 --- a/job/test/posts/steamturbine_defaults_post.json +++ b/job/test/posts/steamturbine_defaults_post.json @@ -1,8 +1,4 @@ { - "ElectricStorage": { - "max_kw": 0.0, - "max_kwh": 0.0 - }, "DomesticHotWaterLoad": { "annual_mmbtu": 67140.53099999999, "doe_reference_name": "Hospital" @@ -18,47 +14,17 @@ "annual_kwh": 3.876408500000039e7, "doe_reference_name": "Hospital" }, - "PV": { - "max_kw": 0.0 - }, - "Financial": { - "offtaker_tax_rate_fraction": 0.26, - "analysis_years": 25, - "om_cost_escalation_rate_fraction": 0.025, - "elec_cost_escalation_rate_fraction": 0.023, - "owner_discount_rate_fraction": 0.083, - "owner_tax_rate_fraction": 0.26, - "existing_boiler_fuel_cost_escalation_rate_fraction": 0.034, - "offtaker_discount_rate_fraction": 0.083, - "third_party_ownership": false - }, "SpaceHeatingLoad": { "annual_mmbtu": 1.15709155e6, "doe_reference_name": "Hospital" }, "SteamTurbine": { - "inlet_steam_temperature_degF": 575.0, - "outlet_steam_pressure_psig": 150.0, - "om_cost_per_kwh": 0.009, - "net_to_gross_electric_ratio": 0.9, - "min_kw": 0, - "gearbox_generator_efficiency": 0.94, - "is_condensing": false, - "inlet_steam_pressure_psig": 600.0, - "outlet_steam_min_vapor_fraction": 0.8, - "max_kw": 20000.0, - "can_wholesale": false, - "installed_cost_per_kw": 682.0, - "can_curtail": false, - "isentropic_efficiency": 0.612, - "om_cost_per_kw": 0.0 + "max_kw": 2000 }, "ExistingBoiler": { "fuel_cost_per_mmbtu": 10.0, - "fuel_type": "natural_gas", "efficiency": 0.8, "can_supply_steam_turbine": true, - "max_thermal_factor_on_peak_load": 1.25, "production_type": "steam" } } \ No newline at end of file diff --git a/job/test/test_validator.py b/job/test/test_validator.py index 1f84d7299..1da6b6c6c 100644 --- a/job/test/test_validator.py +++ b/job/test/test_validator.py @@ -270,6 +270,24 @@ def test_missing_required_keys(self): validator.cross_clean() assert("required inputs" in validator.validation_errors["CHP"].keys()) + def boiler_validation(self): + """ + Validate clean, cross-clean methods are working as expected + """ + post_file = os.path.join('job', 'test', 'posts', 'boiler_test.json') + post = json.load(open(post_file, 'r')) + + post["APIMeta"]["run_uuid"] = uuid.uuid4() + + validator = InputValidator(post) + validator.clean_fields() + validator.clean() + validator.cross_clean() + self.assertEquals(validator.is_valid, True) + # Update with Boiler test fields + # self.assertAlmostEqual(validator.models["ExistingBoiler"].emissions_factor_lb_CO2_per_mmbtu, 117, places=-1) + # self.assertAlmostEqual(len(validator.models["ExistingBoiler"].fuel_cost_per_mmbtu), 8760) + # self.assertAlmostEqual(sum(validator.models["ExistingBoiler"].fuel_cost_per_mmbtu), 8760*0.5) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 99450bbdc..c250c1124 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -11,10 +11,10 @@ uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" version = "1.2.1" [[deps.Adapt]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "195c5505521008abea5aee4f96930717958eac6f" +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "cc37d689f599e8df4f464b2fa3870ff7db7492ef" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.4.0" +version = "3.6.1" [[deps.ArchGDAL]] deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"] @@ -58,9 +58,9 @@ version = "0.7.3" [[deps.Blosc_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "91d6baa911283650df649d0aea7c28639273ae7b" +git-tree-sha1 = "e94024822c0a5b14989abbdba57820ad5b177b95" uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" -version = "1.21.1+0" +version = "1.21.2+0" [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -81,15 +81,15 @@ version = "0.10.9" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb" +git-tree-sha1 = "c6d890a52d2c4d55d326439580c3b8d0875a77d9" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.15.6" +version = "1.15.7" [[deps.ChangesOfVariables]] deps = ["ChainRulesCore", "LinearAlgebra", "Test"] -git-tree-sha1 = "38f7a08f19d8810338d4f5085211c7dfa5d5bdd8" +git-tree-sha1 = "485193efd2176b88e6622a39a246f8c5b600e74e" uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" -version = "0.1.4" +version = "0.1.6" [[deps.CodecBzip2]] deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] @@ -99,9 +99,9 @@ version = "0.7.2" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" +git-tree-sha1 = "9c209fb7536406834aa938fb149964b985de6c83" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.0" +version = "0.7.1" [[deps.ColorTypes]] deps = ["FixedPointNumbers", "Random"] @@ -134,9 +134,9 @@ version = "0.3.0" [[deps.Compat]] deps = ["Dates", "LinearAlgebra", "UUIDs"] -git-tree-sha1 = "00a2cccc7f098ff3b66806862d275ca3db9e6e5a" +git-tree-sha1 = "61fdd77467a5c3ad071ef8277ac6bd6af7dd4c04" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.5.0" +version = "4.6.0" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] @@ -145,9 +145,9 @@ version = "0.5.2+0" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] -git-tree-sha1 = "fb21ddd70a051d882a1686a5a550990bbe371a95" +git-tree-sha1 = "89a9db8d28102b094992472d333674bd1a83ce2a" uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.4.1" +version = "1.5.1" [[deps.CoolProp]] deps = ["CoolProp_jll", "Markdown", "Unitful"] @@ -193,15 +193,15 @@ version = "1.1.0" [[deps.DiffRules]] deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "c5b6685d53f933c11404a3ae9822afe30d522494" +git-tree-sha1 = "a4ad7ef19d2cdc2eff57abbbe68032b1cd0bd8f8" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.12.2" +version = "1.13.0" [[deps.DiskArrays]] deps = ["OffsetArrays"] -git-tree-sha1 = "27ebdcf03ca847fa484f28273db57de3c8514920" +git-tree-sha1 = "3f87990e0882e44c0f4e5c9699d09a0edbfa25c8" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" -version = "0.3.8" +version = "0.3.9" [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] @@ -258,9 +258,9 @@ version = "0.8.4" [[deps.ForwardDiff]] deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "a69dd6db8a809f78846ff259298678f0d6212180" +git-tree-sha1 = "00e252f4d706b3d55a8863432e742bf5717b498d" uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.34" +version = "0.10.35" [[deps.Future]] deps = ["Random"] @@ -274,9 +274,9 @@ version = "1.5.1" [[deps.GDAL_jll]] deps = ["Arrow_jll", "Artifacts", "Expat_jll", "GEOS_jll", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "LibPQ_jll", "Libdl", "Libtiff_jll", "NetCDF_jll", "OpenJpeg_jll", "PROJ_jll", "Pkg", "SQLite_jll", "Zlib_jll", "Zstd_jll", "libgeotiff_jll"] -git-tree-sha1 = "46641669463e45077ea6f08e5c8bd07189173acf" +git-tree-sha1 = "aa913bff49c25482fe3db2c357cb5f8127a6d2ba" uuid = "a7073274-a066-55f0-b90d-d619367d196c" -version = "301.600.100+0" +version = "301.600.200+0" [[deps.GEOS_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -291,9 +291,9 @@ version = "0.4.1" [[deps.GeoInterface]] deps = ["Extents"] -git-tree-sha1 = "fb28b5dc239d0174d7297310ef7b84a11804dfab" +git-tree-sha1 = "e07a1b98ed72e3cdd02c6ceaab94b8a606faca40" uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" -version = "1.0.1" +version = "1.2.1" [[deps.GeoInterfaceRecipes]] deps = ["GeoInterface", "RecipesBase"] @@ -321,15 +321,15 @@ version = "1.1.2" [[deps.H5Zblosc]] deps = ["Blosc", "HDF5"] -git-tree-sha1 = "26b22c9039b039e29ec4f4f989946de722e87ab9" +git-tree-sha1 = "d3966da25e48c05c31cd9786fd201627877612a2" uuid = "c8ec2601-a99c-407f-b158-e79c03c2f5f7" -version = "0.1.0" +version = "0.1.1" [[deps.HDF5]] deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires", "UUIDs"] -git-tree-sha1 = "b5df7c3cab3a00c33c2e09c6bd23982a75e2fbb2" +git-tree-sha1 = "3dab31542b3da9f25a6a1d11159d4af8fdce7d67" uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.16.13" +version = "0.16.14" [[deps.HDF5_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] @@ -351,9 +351,9 @@ version = "0.9.4" [[deps.InfrastructureModels]] deps = ["JuMP", "Memento"] -git-tree-sha1 = "cca034ca1ae73e08bf4db63f158474d40d7dad9a" +git-tree-sha1 = "88da90ad5d8ca541350c156bea2715f3a23836ce" uuid = "2030c09a-7f63-5d83-885d-db604e0e9cc0" -version = "0.7.5" +version = "0.7.6" [[deps.IniFile]] git-tree-sha1 = "f550e6e32074c939295eb5ea6de31849ac2c9625" @@ -362,9 +362,9 @@ version = "0.5.1" [[deps.InlineStrings]] deps = ["Parsers"] -git-tree-sha1 = "0cf92ec945125946352f3d46c96976ab972bde6f" +git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" -version = "1.3.2" +version = "1.4.0" [[deps.InteractiveUtils]] deps = ["Markdown"] @@ -383,9 +383,9 @@ uuid = "3587e190-3f89-42d0-90ee-14403ec27112" version = "0.1.8" [[deps.IrrationalConstants]] -git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151" +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.1.1" +version = "0.2.2" [[deps.IterTools]] git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5" @@ -416,10 +416,10 @@ uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.3" [[deps.JpegTurbo_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "b53380851c6e6664204efb2e62cd24fa5c47e4ba" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6f2675ef130a300a112286de91973805fcc5ffbc" uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" -version = "2.1.2+0" +version = "2.1.91+0" [[deps.JuMP]] deps = ["LinearAlgebra", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SparseArrays"] @@ -503,9 +503,9 @@ version = "2.12.0+0" [[deps.LogExpFunctions]] deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "946607f84feb96220f480e0422d3484c49c00239" +git-tree-sha1 = "0a1b7c2863e44523180fdb3146534e265a91870b" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.19" +version = "0.3.23" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -581,9 +581,9 @@ version = "1.0.5" [[deps.NaNMath]] deps = ["OpenLibm_jll"] -git-tree-sha1 = "a7c3d1da1189a1c2fe843a3bfa04d18d20eb3211" +git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "1.0.1" +version = "1.0.2" [[deps.NetCDF_jll]] deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Pkg", "XML2_jll", "Zlib_jll"] @@ -597,9 +597,9 @@ version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "f71d8950b724e9ff6110fc948dff5a329f901d64" +git-tree-sha1 = "82d7c9e310fe55aa54996e6f7f94674e2a38fcb4" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.8" +version = "1.12.9" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] @@ -619,9 +619,9 @@ version = "0.8.1+0" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f6e9dba33f9f2c44e08a020b0caf6903be540004" +git-tree-sha1 = "9ff31d101d987eb9d66bd8b176ac7c277beccd09" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.19+0" +version = "1.1.20+0" [[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -648,9 +648,9 @@ version = "0.5.11" [[deps.Parsers]] deps = ["Dates", "SnoopPrecompile"] -git-tree-sha1 = "6466e524967496866901a78fca3f2e9ea445a559" +git-tree-sha1 = "478ac6c952fddd4399e71d4779797c538d0ff2bf" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.5.2" +version = "2.5.8" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] @@ -670,10 +670,10 @@ uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" version = "1.4.2" [[deps.PowerModelsDistribution]] -deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "Statistics"] -git-tree-sha1 = "497384070b047898b763a7e9c883c5bc196582ad" +deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SpecialFunctions", "Statistics"] +git-tree-sha1 = "fd2a5efc06acb1b449a985c48d4b3d8004a3b371" uuid = "d7431456-977f-11e9-2de3-97ff7677985e" -version = "0.14.5" +version = "0.14.7" [[deps.Preferences]] deps = ["TOML"] @@ -710,9 +710,9 @@ version = "0.3.2" [[deps.RecipesBase]] deps = ["SnoopPrecompile"] -git-tree-sha1 = "18c35ed630d7229c5584b945641a73ca83fb5213" +git-tree-sha1 = "261dddd3b862bd2c940cf6ca4d1c8fe593e457c8" uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.3.2" +version = "1.3.3" [[deps.Reexport]] git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" @@ -727,25 +727,25 @@ version = "1.3.0" [[deps.Roots]] deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "a3db467ce768343235032a1ca0830fc64158dadf" +git-tree-sha1 = "9c2f5d3768804ed465f0c51540c6074ae9f63900" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.8" +version = "2.0.9" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" version = "0.7.0" [[deps.SQLite_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "2c761a91fb503e94bd0130fcf4352166c3c555bc" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] +git-tree-sha1 = "54d66b0f69f4578f4988fc08d579783fcdcd764f" uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" -version = "3.40.0+1" +version = "3.41.0+0" [[deps.SentinelArrays]] deps = ["Dates", "Random"] -git-tree-sha1 = "efd23b378ea5f2db53a55ae53d3133de4e080aa9" +git-tree-sha1 = "77d3c4726515dca71f6d80fbb5e251088defe305" uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" -version = "1.3.16" +version = "1.3.18" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" @@ -757,9 +757,10 @@ uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" version = "1.1.1" [[deps.SnoopPrecompile]] -git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85" +deps = ["Preferences"] +git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" -version = "1.0.1" +version = "1.0.3" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -770,9 +771,9 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[deps.SpecialFunctions]] deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "d75bda01f8c31ebb72df80a46c88b25d1c79c56d" +git-tree-sha1 = "ef28127915f4229c971eb43f3fc075dd3fe91880" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.1.7" +version = "2.2.0" [[deps.StackViews]] deps = ["OffsetArrays"] @@ -782,9 +783,9 @@ version = "0.1.1" [[deps.StaticArrays]] deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "6954a456979f23d05085727adb17c4551c19ecd1" +git-tree-sha1 = "2d7d9e1ddadc8407ffd460e24218e37ef52dd9a3" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.12" +version = "1.5.16" [[deps.StaticArraysCore]] git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" @@ -829,9 +830,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TestEnv]] deps = ["Pkg"] -git-tree-sha1 = "e458e63fc410c725194e7705c0960bd3d910063a" +git-tree-sha1 = "b5a483bcc8c9f0df569101df166601e5e699f346" uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b" -version = "1.8.1" +version = "1.9.3" [[deps.Thrift_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "boost_jll"] @@ -841,14 +842,14 @@ version = "0.16.0+0" [[deps.TranscodingStreams]] deps = ["Random", "Test"] -git-tree-sha1 = "e4bdc63f5c6d62e80eb1c0043fcc0360d5950ff7" +git-tree-sha1 = "94f38103c984f89cf77c402f2a68dbd870f8165f" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.10" +version = "0.9.11" [[deps.URIs]] -git-tree-sha1 = "ac00576f90d8a259f2c9d823e91d1de3fd44d348" +git-tree-sha1 = "074f993b0ca030848b897beff716d93aca60f06a" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.4.1" +version = "1.4.2" [[deps.UUIDs]] deps = ["Random", "SHA"] @@ -859,9 +860,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "d670a70dd3cdbe1c1186f2f17c9a68a7ec24838c" +git-tree-sha1 = "bb37ed24f338bc59b83e3fc9f32dd388e5396c53" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.12.2" +version = "1.12.4" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] @@ -892,10 +893,10 @@ uuid = "83775a58-1f1d-513f-b197-d71354ab007a" version = "1.2.12+3" [[deps.Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e45044cd873ded54b6a5bac0eb5c971392cf1927" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "c6edfe154ad7b313c01aceca188c05c835c67360" uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.2+0" +version = "1.5.4+0" [[deps.boost_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] diff --git a/julia_src/http.jl b/julia_src/http.jl index d6835a6bf..0d8de1adc 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -212,6 +212,7 @@ end # Should this accept all inputs provided in `get_steam_turbine_defaults_size_class` docstring in REopt.jl? function steamturbine_defaults(req::HTTP.Request) + d = JSON.parse(String(req.body)) keys = ["avg_boiler_fuel_load_mmbtu_per_hour", "size_class" @@ -221,7 +222,7 @@ function steamturbine_defaults(req::HTTP.Request) if !haskey(d, k) d[k] = nothing elseif !isnothing(d[k]) - if k in ["avg_boiler_fuel_load_mmbtu_per_hour"] && typeof(d[k]) == String + if k == "avg_boiler_fuel_load_mmbtu_per_hour" && typeof(d[k]) == String d[k] = parse(Float64, d[k]) elseif k == "size_class" && typeof(d[k]) == String d[k] = parse(Int64, d[k]) From 7625df74c098417168ad8b807bb3b6dba2ee177e Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 6 Mar 2023 19:42:50 -0500 Subject: [PATCH 07/92] troubleshoot steamturbine tests --- ...uts_inlet_steam_superheat_degf_and_more.py | 24 ++++++++ job/models.py | 4 +- job/src/process_results.py | 6 +- job/test/posts/all_inputs_test.json | 17 +++++- julia_src/Manifest.toml | 58 +++++++++++++++++-- julia_src/http.jl | 3 +- 6 files changed, 102 insertions(+), 10 deletions(-) create mode 100644 job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py diff --git a/job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py b/job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py new file mode 100644 index 000000000..4b781f0c0 --- /dev/null +++ b/job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 4.0.7 on 2023-03-06 23:18 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='steamturbineinputs', + name='inlet_steam_superheat_degF', + field=models.FloatField(default=0.0, help_text='Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(700.0)]), + ), + migrations.AlterField( + model_name='steamturbineinputs', + name='om_cost_per_kw', + field=models.FloatField(default=0.0, help_text='Annual steam turbine fixed operations and maintenance costs in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(5000.0)]), + ), + ] diff --git a/job/models.py b/job/models.py index c68d6ceda..9c237e602 100644 --- a/job/models.py +++ b/job/models.py @@ -4748,7 +4748,7 @@ class SIZE_CLASS_LIST(models.IntegerChoices): MinValueValidator(0.0), MaxValueValidator(700.0) ], - blank=True, + default=0.0, help_text="Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine" ) @@ -4777,7 +4777,7 @@ class SIZE_CLASS_LIST(models.IntegerChoices): MinValueValidator(0.0), MaxValueValidator(5.0e3) ], - blank=True, + default=0.0, null=True, help_text="Annual steam turbine fixed operations and maintenance costs in $/kW" ) diff --git a/job/src/process_results.py b/job/src/process_results.py index 6c438cdca..ae0584e5d 100644 --- a/job/src/process_results.py +++ b/job/src/process_results.py @@ -30,7 +30,7 @@ from job.models import REoptjlMessageOutputs, FinancialOutputs, APIMeta, PVOutputs, ElectricStorageOutputs, ElectricTariffOutputs, SiteOutputs,\ ElectricUtilityOutputs, GeneratorOutputs, ElectricLoadOutputs, WindOutputs, FinancialInputs, ElectricUtilityInputs, ExistingBoilerOutputs,\ CHPInputs, CHPOutputs, ExistingChillerOutputs, CoolingLoadOutputs, HeatingLoadOutputs, HotThermalStorageOutputs, ColdThermalStorageOutputs, \ - BoilerOutputs, SteamTurbineOutputs + BoilerOutputs, SteamTurbineInputs, SteamTurbineOutputs import logging log = logging.getLogger(__name__) import sys @@ -99,8 +99,12 @@ def update_inputs_in_database(inputs_to_update: dict, run_uuid: str) -> None: # get input models that need updating FinancialInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["Financial"]) ElectricUtilityInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["ElectricUtility"]) + if inputs_to_update["CHP"]: # Will be an empty dictionary if CHP is not considered CHPInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["CHP"]) + if inputs_to_update["SteamTurbine"]: # Will be an empty dictionary if SteamTurbine is not considered + SteamTurbineInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["SteamTurbine"]) + except Exception as e: exc_type, exc_value, exc_traceback = sys.exc_info() debug_msg = "exc_type: {}; exc_value: {}; exc_traceback: {}".format( diff --git a/job/test/posts/all_inputs_test.json b/job/test/posts/all_inputs_test.json index d7f5ed65e..622d71f61 100644 --- a/job/test/posts/all_inputs_test.json +++ b/job/test/posts/all_inputs_test.json @@ -252,7 +252,7 @@ "fuel_type": "natural_gas" }, "SpaceHeatingLoad": { - "annual_mmbtu": null, + "annual_mmbtu": 8760.0, "doe_reference_name": "MidriseApartment", "monthly_mmbtu": [], "fuel_loads_mmbtu_per_hour": [], @@ -260,11 +260,24 @@ "blended_doe_reference_percents": [] }, "DomesticHotWaterLoad": { - "annual_mmbtu": null, + "annual_mmbtu": 8760.0, "doe_reference_name": "MidriseApartment", "monthly_mmbtu": [], "fuel_loads_mmbtu_per_hour": [], "blended_doe_reference_names": [], "blended_doe_reference_percents": [] + }, + "Boiler": { + "min_mmbtu_per_hour": 0.0, + "max_mmbtu_per_hour": 100000000.0, + "efficiency": 0.8, + "fuel_cost_per_mmbtu": 0.05, + "macrs_option_years": 0, + "macrs_bonus_fraction": 0.0, + "installed_cost_per_mmbtu_per_hour": 0.001, + "om_cost_per_mmbtu_per_hour": 0.0, + "om_cost_per_mmbtu": 0.0, + "fuel_type": "natural_gas", + "can_supply_steam_turbine": true } } \ No newline at end of file diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index c250c1124..7df46f24a 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -134,9 +134,9 @@ version = "0.3.0" [[deps.Compat]] deps = ["Dates", "LinearAlgebra", "UUIDs"] -git-tree-sha1 = "61fdd77467a5c3ad071ef8277ac6bd6af7dd4c04" +git-tree-sha1 = "7a60c856b9fa189eb34f5f8a6f6b5529b7942957" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.6.0" +version = "4.6.1" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] @@ -161,11 +161,22 @@ git-tree-sha1 = "6b492e9aafcd6016d5aca105567ed2271c423015" uuid = "3351c21f-4feb-5f29-afb9-f4fcb0e27549" version = "6.4.3+0" +[[deps.Crayons]] +git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.1.1" + [[deps.DataAPI]] git-tree-sha1 = "e8119c1a33d267e16108be441a287a6981ba1630" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" version = "1.14.0" +[[deps.DataFrames]] +deps = ["Compat", "DataAPI", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "aa51303df86f8626a962fccb878430cdb0a97eee" +uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +version = "1.5.0" + [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0" @@ -256,6 +267,12 @@ git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" version = "0.8.4" +[[deps.Formatting]] +deps = ["Printf"] +git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" +uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" +version = "0.4.2" + [[deps.ForwardDiff]] deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] git-tree-sha1 = "00e252f4d706b3d55a8863432e742bf5717b498d" @@ -382,6 +399,11 @@ git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f" uuid = "3587e190-3f89-42d0-90ee-14403ec27112" version = "0.1.8" +[[deps.InvertedIndices]] +git-tree-sha1 = "82aec7a3dd64f4d9584659dc0b62ef7db2ef3e19" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.2.0" + [[deps.IrrationalConstants]] git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" @@ -445,6 +467,11 @@ git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6" uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" version = "2.10.1+0" +[[deps.LaTeXStrings]] +git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996" +uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" +version = "1.3.0" + [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" @@ -560,6 +587,12 @@ git-tree-sha1 = "bb2e8f4d9f400f6e90d57b34860f6abdc51398e5" uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" version = "1.4.1" +[[deps.Missings]] +deps = ["DataAPI"] +git-tree-sha1 = "f66bdc5de519e8f8ae43bdc598782d35a25b1272" +uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +version = "1.1.0" + [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" @@ -681,6 +714,12 @@ git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d" uuid = "21216c6a-2e73-6563-6e65-726566657250" version = "1.3.0" +[[deps.PrettyTables]] +deps = ["Crayons", "Formatting", "LaTeXStrings", "Markdown", "Reexport", "StringManipulation", "Tables"] +git-tree-sha1 = "96f6db03ab535bdb901300f88335257b0018689d" +uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +version = "2.2.2" + [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" @@ -694,8 +733,8 @@ deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] -deps = ["ArchGDAL", "CoolProp", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "7c1ceee55c1460444167d80a485e785b759316b8" +deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] +path = "C:\\Users\\BRATHOD\\.julia\\dev\\REopt" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" version = "0.25.0" @@ -765,6 +804,12 @@ version = "1.0.3" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" +[[deps.SortingAlgorithms]] +deps = ["DataStructures"] +git-tree-sha1 = "a4ada03f999bd01b3a25dcaa30b2d929fe537e00" +uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" +version = "1.1.0" + [[deps.SparseArrays]] deps = ["LinearAlgebra", "Random"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" @@ -796,6 +841,11 @@ version = "1.4.0" deps = ["LinearAlgebra", "SparseArrays"] uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +[[deps.StringManipulation]] +git-tree-sha1 = "46da2434b41f41ac3594ee9816ce5541c6096123" +uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e" +version = "0.3.0" + [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" diff --git a/julia_src/http.jl b/julia_src/http.jl index 0d8de1adc..c59edcd77 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -105,7 +105,8 @@ function reopt(req::HTTP.Request) inputs_with_defaults_from_steamturbine = [ :size_class, :gearbox_generator_efficiency, :isentropic_efficiency, :inlet_steam_pressure_psig, :inlet_steam_temperature_degF, :installed_cost_per_kw, :om_cost_per_kwh, - :outlet_steam_pressure_psig, :net_to_gross_electric_ratio + :outlet_steam_pressure_psig, :net_to_gross_electric_ratio, :electric_produced_to_thermal_consumed_ratio, + :thermal_produced_to_thermal_consumed_ratio ] steamturbine_dict = Dict(key=>getfield(model_inputs.s.steam_turbine, key) for key in inputs_with_defaults_from_steamturbine) else From a32134675875e22df932433a806e826453e28601 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 6 Mar 2023 21:38:59 -0500 Subject: [PATCH 08/92] update tests for Boiler and Steamturbine --- job/models.py | 9 ++++++++- ...xisting_boiler.json => existingboiler_boiler.json} | 3 +++ job/test/test_validator.py | 11 ++++++++--- job/validators.py | 9 +++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) rename job/test/posts/{existing_boiler.json => existingboiler_boiler.json} (89%) diff --git a/job/models.py b/job/models.py index 9c237e602..9d3cf34f9 100644 --- a/job/models.py +++ b/job/models.py @@ -4461,7 +4461,7 @@ class BoilerInputs(BaseModel, models.Model): ] ), default=list, - blank=True, + null=True, help_text="Fuel cost in [$/MMBtu]" ) @@ -4534,6 +4534,13 @@ class BoilerInputs(BaseModel, models.Model): # For custom validations within model. def clean(self): + error_messages = {} + if not self.dict.get("fuel_cost_per_mmbtu"): + error_messages["required inputs"] = "Must provide fuel_cost_per_mmbtu to model {}".format(self.key) + + if error_messages: + raise ValidationError(error_messages) + self.fuel_cost_per_mmbtu = scalar_to_vector(self.fuel_cost_per_mmbtu) class BoilerOutputs(BaseModel, models.Model): diff --git a/job/test/posts/existing_boiler.json b/job/test/posts/existingboiler_boiler.json similarity index 89% rename from job/test/posts/existing_boiler.json rename to job/test/posts/existingboiler_boiler.json index 1626ac0be..79c993f7b 100644 --- a/job/test/posts/existing_boiler.json +++ b/job/test/posts/existingboiler_boiler.json @@ -6,6 +6,9 @@ "ExistingBoiler": { "fuel_cost_per_mmbtu": 0.5 }, + "Boiler": { + "fuel_cost_per_mmbtu": 0.25 + }, "HotThermalStorage":{ "max_gal":2500 }, diff --git a/job/test/test_validator.py b/job/test/test_validator.py index 1da6b6c6c..59f17627c 100644 --- a/job/test/test_validator.py +++ b/job/test/test_validator.py @@ -178,12 +178,12 @@ def test_off_grid_defaults_overrides(self): self.assertAlmostEqual(validator.models["Generator"].replacement_year, 7) self.assertAlmostEqual(validator.models["Generator"].replace_cost_per_kw, 200.0) - def existing_boiler_validation(self): + def existingboiler_boiler_validation(self): """ Validate clean, cross-clean methods are working as expected """ - post_file = os.path.join('job', 'test', 'posts', 'existing_boiler.json') + post_file = os.path.join('job', 'test', 'posts', 'existingboiler_boiler.json') post = json.load(open(post_file, 'r')) post["APIMeta"]["run_uuid"] = uuid.uuid4() @@ -197,6 +197,9 @@ def existing_boiler_validation(self): self.assertAlmostEqual(validator.models["ExistingBoiler"].emissions_factor_lb_CO2_per_mmbtu, 117, places=-1) self.assertAlmostEqual(len(validator.models["ExistingBoiler"].fuel_cost_per_mmbtu), 8760) self.assertAlmostEqual(sum(validator.models["ExistingBoiler"].fuel_cost_per_mmbtu), 8760*0.5) + + self.assertAlmostEqual(len(validator.models["Boiler"].fuel_cost_per_mmbtu), 8760) + self.assertAlmostEqual(sum(validator.models["Boiler"].fuel_cost_per_mmbtu), 8760*0.25) # Ensure Hot Thermal Storage System parameter is loaded from json self.assertAlmostEqual(validator.models["HotThermalStorage"].max_gal, 2500.0) @@ -204,6 +207,7 @@ def existing_boiler_validation(self): # Validate 12 month fuel cost vector gets scaled correctly post["ExistingBoiler"]["fuel_cost_per_mmbtu"] = [1,2,1,1,1,1,1,1,1,1,1,1] + post["Boiler"]["fuel_cost_per_mmbtu"] = [0.5,1,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5] post["APIMeta"]["run_uuid"] = uuid.uuid4() @@ -215,7 +219,8 @@ def existing_boiler_validation(self): self.assertAlmostEqual(len(validator.models["ExistingBoiler"].fuel_cost_per_mmbtu), 8760) self.assertEqual(sum(validator.models["ExistingBoiler"].fuel_cost_per_mmbtu), 9432.0) - # With old code, the total for last assertion would have been 9490 (i.e. 8760+730) + self.assertAlmostEqual(len(validator.models["Boiler"].fuel_cost_per_mmbtu), 8760) + self.assertEqual(sum(validator.models["Boiler"].fuel_cost_per_mmbtu), 9432.0*0.5) def test_missing_required_keys(self): #start with on_grid, and keep all keys diff --git a/job/validators.py b/job/validators.py index 8da511ff3..9771f2ead 100644 --- a/job/validators.py +++ b/job/validators.py @@ -422,12 +422,21 @@ def update_pv_defaults_offgrid(self): """ if "ExistingBoiler" in self.models.keys(): + self.clean_time_series("ExistingBoiler", "fuel_loads_mmbtu_per_hour") + if self.models["ExistingBoiler"].efficiency is None: if self.models["ExistingBoiler"].production_type == 'hot_water': self.models["ExistingBoiler"].efficiency = 0.8 else: self.models["ExistingBoiler"].efficiency = 0.75 + """ + Boiler + """ + if "Boiler" in self.models.keys(): + + self.clean_time_series("ExistingBoiler", "fuel_loads_mmbtu_per_hour") + """ ElectricLoad If user does not provide values, set defaults conditional on off-grid flag From 75e3e3f207c40779af19d7ca79ce775d6927603b Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Tue, 7 Mar 2023 15:17:52 -0500 Subject: [PATCH 09/92] Fix bugs --- ..._alter_boilerinputs_fuel_cost_per_mmbtu.py | 20 +++++++++++++++++++ job/validators.py | 4 ++-- julia_src/Manifest.toml | 4 +++- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py diff --git a/job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py b/job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py new file mode 100644 index 000000000..39c017e71 --- /dev/null +++ b/job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py @@ -0,0 +1,20 @@ +# Generated by Django 4.0.7 on 2023-03-07 20:00 + +import django.contrib.postgres.fields +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='boilerinputs', + name='fuel_cost_per_mmbtu', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), default=list, help_text='Fuel cost in [$/MMBtu]', null=True, size=None), + ), + ] diff --git a/job/validators.py b/job/validators.py index 9771f2ead..0246a6c05 100644 --- a/job/validators.py +++ b/job/validators.py @@ -422,7 +422,7 @@ def update_pv_defaults_offgrid(self): """ if "ExistingBoiler" in self.models.keys(): - self.clean_time_series("ExistingBoiler", "fuel_loads_mmbtu_per_hour") + self.clean_time_series("ExistingBoiler", "fuel_cost_per_mmbtu") if self.models["ExistingBoiler"].efficiency is None: if self.models["ExistingBoiler"].production_type == 'hot_water': @@ -435,7 +435,7 @@ def update_pv_defaults_offgrid(self): """ if "Boiler" in self.models.keys(): - self.clean_time_series("ExistingBoiler", "fuel_loads_mmbtu_per_hour") + self.clean_time_series("Boiler", "fuel_cost_per_mmbtu") """ ElectricLoad diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 7df46f24a..805889f00 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -734,7 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -path = "C:\\Users\\BRATHOD\\.julia\\dev\\REopt" +git-tree-sha1 = "aba874b4af7324edb57e23d98b502cb145bc1859" +repo-rev = "boiler_stmturbine_debug" +repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" version = "0.25.0" From 869461a3e3e4dcebad93850df97332b21860157d Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Tue, 7 Mar 2023 15:56:34 -0500 Subject: [PATCH 10/92] Fix migrations --- ...talled_cost_per_mmbtu_per_hour_and_more.py | 190 ------------------ ...leroutputs_steamturbineinputs_and_more.py} | 186 ++--------------- ...uts_inlet_steam_superheat_degf_and_more.py | 24 --- ..._alter_boilerinputs_fuel_cost_per_mmbtu.py | 20 -- 4 files changed, 18 insertions(+), 402 deletions(-) delete mode 100644 job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py rename job/migrations/{0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py => 0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py} (50%) delete mode 100644 job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py delete mode 100644 job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py diff --git a/job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py b/job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py deleted file mode 100644 index c7fe894ab..000000000 --- a/job/migrations/0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more.py +++ /dev/null @@ -1,190 +0,0 @@ -# Generated by Django 4.0.7 on 2023-02-28 03:34 - -import django.contrib.postgres.fields -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('job', '0025_boilerinputs_boileroutputs_steamturbineinputs_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='boilerinputs', - name='installed_cost_per_mmbtu_per_hour', - field=models.FloatField(blank=True, default=293000.0, help_text='Thermal power-based cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='boilerinputs', - name='max_mmbtu_per_hour', - field=models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='boilerinputs', - name='min_mmbtu_per_hour', - field=models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='boilerinputs', - name='om_cost_per_mmbtu', - field=models.FloatField(blank=True, default=0.0, help_text='Thermal energy-based variable O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='boilerinputs', - name='om_cost_per_mmbtu_per_hour', - field=models.FloatField(blank=True, default=2930.0, help_text='Thermal power-based fixed O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='chpinputs', - name='max_kw', - field=models.FloatField(blank=True, help_text='Maximum CHP size (in kWe) constraint for optimization. Set to zero to disable CHP', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='chpinputs', - name='min_allowable_kw', - field=models.FloatField(blank=True, help_text='Minimum nonzero CHP size (in kWe) (i.e. it is possible to select no CHP system)', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadinputs', - name='annual_tonhour', - field=models.FloatField(blank=True, help_text="Annual electric chiller thermal energy production, in [Ton-Hour],used to scale simulated default electric chiller load profile for the site's climate zone", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadinputs', - name='monthly_tonhour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text="Monthly site space cooling requirement in [Ton-Hour], used to scale simulated default building load profile for the site's climate zone", size=None), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='annual_calculated_tonhour', - field=models.FloatField(blank=True, default=0, help_text='Annual site total cooling load [tonhr]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='annual_electric_chiller_base_load_kwh', - field=models.FloatField(blank=True, default=0, help_text='Annual total base load drawn from chiller [kWh-electric]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='electric_chiller_base_load_series_kw', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total base load drawn from chiller [kW-electric]', size=None), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='load_series_ton', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total cooling load [ton]', size=None), - ), - migrations.AlterField( - model_name='domestichotwaterloadinputs', - name='annual_mmbtu', - field=models.FloatField(blank=True, help_text="Annual site DHW consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='domestichotwaterloadinputs', - name='monthly_mmbtu', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text="Monthly site DHW energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), - ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_CO2_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_NOx_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_PM25_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_SO2_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='generatorinputs', - name='fuel_avail_gal', - field=models.FloatField(blank=True, help_text='On-site generator fuel available in gallons per year.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='generatorinputs', - name='replace_cost_per_kw', - field=models.FloatField(blank=True, help_text='Per kW replacement cost for generator capacity. Replacement costs are considered tax deductible.', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_dhw_boiler_fuel_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site DHW boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_dhw_thermal_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site DHW load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_space_heating_boiler_fuel_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site space heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_space_heating_thermal_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site space heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_total_heating_boiler_fuel_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site total heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_total_heating_thermal_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site total heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='dhw_boiler_fuel_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='dhw_thermal_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='space_heating_boiler_fuel_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='space_heating_thermal_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='total_heating_boiler_fuel_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='total_heating_thermal_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='spaceheatingloadinputs', - name='annual_mmbtu', - field=models.FloatField(blank=True, help_text="Annual site space heating consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100000000.0)]), - ), - migrations.AlterField( - model_name='spaceheatingloadinputs', - name='monthly_mmbtu', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)]), blank=True, default=list, help_text="Monthly site space heating energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), - ), - ] diff --git a/job/migrations/0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py b/job/migrations/0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py similarity index 50% rename from job/migrations/0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py rename to job/migrations/0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py index fb18621b5..d491db83c 100644 --- a/job/migrations/0025_boilerinputs_boileroutputs_steamturbineinputs_and_more.py +++ b/job/migrations/0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 4.0.7 on 2023-02-27 16:12 +# Generated by Django 4.0.7 on 2023-03-07 20:31 import django.contrib.postgres.fields import django.core.validators @@ -10,7 +10,7 @@ class Migration(migrations.Migration): dependencies = [ - ('job', '0024_alter_electrictariffinputs_blended_annual_demand_rate'), + ('job', '0025_merge_20230202_1907'), ] operations = [ @@ -18,15 +18,15 @@ class Migration(migrations.Migration): name='BoilerInputs', fields=[ ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerInputs', serialize=False, to='job.apimeta')), - ('min_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)])), - ('max_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('min_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), + ('max_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), ('efficiency', models.FloatField(default=0.8, help_text='New boiler system efficiency - conversion of fuel to usable heating thermal energy.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), - ('fuel_cost_per_mmbtu', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='Fuel cost in [$/MMBtu]', size=None)), + ('fuel_cost_per_mmbtu', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), default=list, help_text='Fuel cost in [$/MMBtu]', null=True, size=None)), ('macrs_option_years', models.IntegerField(blank=True, choices=[(0, 'Zero'), (5, 'Five'), (7, 'Seven')], default=0, help_text='Duration over which accelerated depreciation will occur. Set to zero to disable', null=True)), ('macrs_bonus_fraction', models.FloatField(blank=True, default=0.0, help_text='Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])), - ('installed_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=293000.0, help_text='Thermal power-based cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), - ('om_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=2930.0, help_text='Thermal power-based fixed O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), - ('om_cost_per_mmbtu', models.FloatField(blank=True, default=0.0, help_text='Thermal energy-based variable O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), + ('installed_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=293000.0, help_text='Thermal power-based cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), + ('om_cost_per_mmbtu_per_hour', models.FloatField(blank=True, default=2930.0, help_text='Thermal power-based fixed O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), + ('om_cost_per_mmbtu', models.FloatField(blank=True, default=0.0, help_text='Thermal energy-based variable O&M cost', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100000000.0)])), ('fuel_type', models.TextField(blank=True, choices=[('natural_gas', 'Natural Gas'), ('landfill_bio_gas', 'Landfill Bio Gas'), ('propane', 'Propane'), ('diesel_oil', 'Diesel Oil'), ('uranium', 'Uranium')], default='natural_gas', help_text='Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil, uranium', null=True)), ('can_supply_steam_turbine', models.BooleanField(blank=True, default=True, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True)), ], @@ -54,23 +54,23 @@ class Migration(migrations.Migration): name='SteamTurbineInputs', fields=[ ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SteamTurbineInputs', serialize=False, to='job.apimeta')), - ('size_class', models.IntegerField(blank=True, choices=[(0, 'Zero'), (1, 'One'), (2, 'Two'), (4, 'Four')], help_text='Steam turbine size class for using appropriate default inputs', null=True)), ('min_kw', models.FloatField(blank=True, default=0.0, help_text='Minimum steam turbine size constraint for optimization', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), ('max_kw', models.FloatField(blank=True, default=0.0, help_text='Maximum steam turbine size constraint for optimization', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), - ('electric_produced_to_thermal_consumed_ratio', models.FloatField(blank=True, help_text='Simplified input as alternative to detailed calculations from inlet and outlet steam conditions', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), - ('thermal_produced_to_thermal_consumed_ratio', models.FloatField(blank=True, help_text='Simplified input as alternative to detailed calculations from condensing outlet steam', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), - ('is_condensing', models.BooleanField(blank=True, default=False, help_text='Steam turbine type, if it is a condensing turbine which produces no useful thermal (max electric output)')), + ('size_class', models.IntegerField(blank=True, choices=[(0, 'Zero'), (1, 'One'), (2, 'Two'), (4, 'Four')], help_text='Steam turbine size class for using appropriate default inputs', null=True)), + ('gearbox_generator_efficiency', models.FloatField(blank=True, help_text='Combined gearbox (if applicable) and electric motor/generator efficiency', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), ('inlet_steam_pressure_psig', models.FloatField(blank=True, help_text='Inlet steam pressure to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(5000.0)])), ('inlet_steam_temperature_degF', models.FloatField(blank=True, help_text='Inlet steam temperature to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1300.0)])), - ('inlet_steam_superheat_degF', models.FloatField(blank=True, help_text='Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(700.0)])), + ('installed_cost_per_kw', models.FloatField(blank=True, help_text='Installed steam turbine cost in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000.0)])), + ('om_cost_per_kwh', models.FloatField(blank=True, help_text='Steam turbine per unit production (variable) operations and maintenance costs in $/kWh', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100.0)])), ('outlet_steam_pressure_psig', models.FloatField(blank=True, help_text='Outlet steam pressure from the steam turbine (to the condenser or heat recovery unit)', null=True, validators=[django.core.validators.MinValueValidator(-14.7), django.core.validators.MaxValueValidator(1000.0)])), + ('net_to_gross_electric_ratio', models.FloatField(blank=True, help_text='Efficiency factor to account for auxiliary loads such as pumps, controls, lights, etc', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('electric_produced_to_thermal_consumed_ratio', models.FloatField(blank=True, help_text='Simplified input as alternative to detailed calculations from inlet and outlet steam conditions', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('thermal_produced_to_thermal_consumed_ratio', models.FloatField(blank=True, help_text='Simplified input as alternative to detailed calculations from condensing outlet steam', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), + ('is_condensing', models.BooleanField(blank=True, default=False, help_text='Steam turbine type, if it is a condensing turbine which produces no useful thermal (max electric output)')), + ('inlet_steam_superheat_degF', models.FloatField(default=0.0, help_text='Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(700.0)])), ('outlet_steam_min_vapor_fraction', models.FloatField(blank=True, default=0.8, help_text='Minimum practical vapor fraction of steam at the exit of the steam turbine', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), ('isentropic_efficiency', models.FloatField(blank=True, help_text='Steam turbine isentropic efficiency - uses inlet T/P and outlet T/P/X to get power out', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), - ('gearbox_generator_efficiency', models.FloatField(blank=True, help_text='Combined gearbox (if applicable) and electric motor/generator efficiency', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), - ('net_to_gross_electric_ratio', models.FloatField(blank=True, help_text='Efficiency factor to account for auxiliary loads such as pumps, controls, lights, etc', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), - ('installed_cost_per_kw', models.FloatField(blank=True, help_text='Installed steam turbine cost in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000.0)])), - ('om_cost_per_kw', models.FloatField(blank=True, help_text='Annual steam turbine fixed operations and maintenance costs in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(5000.0)])), - ('om_cost_per_kwh', models.FloatField(blank=True, help_text='Steam turbine per unit production (variable) operations and maintenance costs in $/kWh', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100.0)])), + ('om_cost_per_kw', models.FloatField(default=0.0, help_text='Annual steam turbine fixed operations and maintenance costs in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(5000.0)])), ('can_net_meter', models.BooleanField(blank=True, default=False, help_text='True/False for if technology has option to participate in net metering agreement with utility. Note that a technology can only participate in either net metering or wholesale rates (not both).Note that if off-grid is true, net metering is always set to False.')), ('can_wholesale', models.BooleanField(blank=True, default=False, help_text='True/False for if technology has option to export energy that is compensated at the wholesale_rate. Note that a technology can only participate in either net metering or wholesale rates (not both).Note that if off-grid is true, can_wholesale is always set to False.')), ('can_export_beyond_nem_limit', models.BooleanField(blank=True, default=False, help_text='True/False for if technology can export energy beyond the annual site load (and be compensated for that energy at the export_rate_beyond_net_metering_limit).Note that if off-grid is true, can_export_beyond_nem_limit is always set to False.')), @@ -98,159 +98,9 @@ class Migration(migrations.Migration): ], bases=(job.models.BaseModel, models.Model), ), - migrations.AlterField( - model_name='chpinputs', - name='max_kw', - field=models.FloatField(blank=True, help_text='Maximum CHP size (in kWe) constraint for optimization. Set to zero to disable CHP', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='chpinputs', - name='min_allowable_kw', - field=models.FloatField(blank=True, help_text='Minimum nonzero CHP size (in kWe) (i.e. it is possible to select no CHP system)', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadinputs', - name='annual_tonhour', - field=models.FloatField(blank=True, help_text="Annual electric chiller thermal energy production, in [Ton-Hour],used to scale simulated default electric chiller load profile for the site's climate zone", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadinputs', - name='monthly_tonhour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text="Monthly site space cooling requirement in [Ton-Hour], used to scale simulated default building load profile for the site's climate zone", size=None), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='annual_calculated_tonhour', - field=models.FloatField(blank=True, default=0, help_text='Annual site total cooling load [tonhr]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='annual_electric_chiller_base_load_kwh', - field=models.FloatField(blank=True, default=0, help_text='Annual total base load drawn from chiller [kWh-electric]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='electric_chiller_base_load_series_kw', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total base load drawn from chiller [kW-electric]', size=None), - ), - migrations.AlterField( - model_name='coolingloadoutputs', - name='load_series_ton', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total cooling load [ton]', size=None), - ), - migrations.AlterField( - model_name='domestichotwaterloadinputs', - name='annual_mmbtu', - field=models.FloatField(blank=True, help_text="Annual site DHW consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='domestichotwaterloadinputs', - name='monthly_mmbtu', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text="Monthly site DHW energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), - ), migrations.AlterField( model_name='electrictariffinputs', name='export_rate_beyond_net_metering_limit', field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='Price of electricity sold back to the grid above the site load, regardless of net metering. Can be a scalar value, which applies for all-time, or an array with time-sensitive values. If an array is input then it must have a length of 8760, 17520, or 35040. The inputed array values are up/down-sampled using mean values to match the Scenario time_steps_per_hour.', size=None), ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_CO2_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_NOx_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_PM25_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='existingboilerinputs', - name='emissions_factor_lb_SO2_per_mmbtu', - field=models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='generatorinputs', - name='fuel_avail_gal', - field=models.FloatField(blank=True, help_text='On-site generator fuel available in gallons per year.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(10000000000.0)]), - ), - migrations.AlterField( - model_name='generatorinputs', - name='replace_cost_per_kw', - field=models.FloatField(blank=True, help_text='Per kW replacement cost for generator capacity. Replacement costs are considered tax deductible.', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(10000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_dhw_boiler_fuel_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site DHW boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_dhw_thermal_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site DHW load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_space_heating_boiler_fuel_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site space heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_space_heating_thermal_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site space heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_total_heating_boiler_fuel_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site total heating boiler fuel load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='annual_calculated_total_heating_thermal_load_mmbtu', - field=models.FloatField(blank=True, default=0, help_text='Annual site total heating load [MMBTU]', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='dhw_boiler_fuel_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='dhw_thermal_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic hot water load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='space_heating_boiler_fuel_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='space_heating_thermal_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly domestic space heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='total_heating_boiler_fuel_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='heatingloadoutputs', - name='total_heating_thermal_load_series_mmbtu_per_hour', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text='Hourly total heating load [MMBTU/hr]', size=None), - ), - migrations.AlterField( - model_name='spaceheatingloadinputs', - name='annual_mmbtu', - field=models.FloatField(blank=True, help_text="Annual site space heating consumption, used to scale simulated default building load profile for the site's climate zone [MMBtu]", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1000000000.0)]), - ), - migrations.AlterField( - model_name='spaceheatingloadinputs', - name='monthly_mmbtu', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)]), blank=True, default=list, help_text="Monthly site space heating energy consumption in [MMbtu], used to scale simulated default building load profile for the site's climate zone", size=None), - ), ] diff --git a/job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py b/job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py deleted file mode 100644 index 4b781f0c0..000000000 --- a/job/migrations/0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 4.0.7 on 2023-03-06 23:18 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('job', '0026_alter_boilerinputs_installed_cost_per_mmbtu_per_hour_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='steamturbineinputs', - name='inlet_steam_superheat_degF', - field=models.FloatField(default=0.0, help_text='Alternative input to inlet steam temperature, this is the superheat amount (delta from T_saturation) to the steam turbine', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(700.0)]), - ), - migrations.AlterField( - model_name='steamturbineinputs', - name='om_cost_per_kw', - field=models.FloatField(default=0.0, help_text='Annual steam turbine fixed operations and maintenance costs in $/kW', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(5000.0)]), - ), - ] diff --git a/job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py b/job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py deleted file mode 100644 index 39c017e71..000000000 --- a/job/migrations/0028_alter_boilerinputs_fuel_cost_per_mmbtu.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 4.0.7 on 2023-03-07 20:00 - -import django.contrib.postgres.fields -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('job', '0027_alter_steamturbineinputs_inlet_steam_superheat_degf_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='boilerinputs', - name='fuel_cost_per_mmbtu', - field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), default=list, help_text='Fuel cost in [$/MMBtu]', null=True, size=None), - ), - ] From f9a6eb7bbab2c786806d9e607aa2f1409fa16253 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 29 Mar 2023 20:32:39 -0600 Subject: [PATCH 11/92] Add temp dummy file to prevent unintended undeploy --- dummy_file.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 dummy_file.txt diff --git a/dummy_file.txt b/dummy_file.txt new file mode 100644 index 000000000..aac8259a2 --- /dev/null +++ b/dummy_file.txt @@ -0,0 +1,3 @@ +This is a dummy file commited to erp-main branch so that the master branch +does not think this branch has already been merged and therefore undeploys +it from the staging server when master is deployed. \ No newline at end of file From 74389fef22cb1ccfdcd4b4f9e996dd76dec0f22f Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sat, 1 Apr 2023 15:24:22 -0600 Subject: [PATCH 12/92] Add compute resources to staging deploy --- .helm/values.staging.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.helm/values.staging.yaml b/.helm/values.staging.yaml index d7cfc7107..1fc67a970 100644 --- a/.helm/values.staging.yaml +++ b/.helm/values.staging.yaml @@ -1,2 +1,7 @@ appEnv: staging -djangoSettingsModule: reopt_api.staging_settings \ No newline at end of file +djangoSettingsModule: reopt_api.staging_settings +juliaReplicas: 2 +juliaCpuRequest: "2000m" +juliaCpuLimit: "3000m" +juliaMemoryRequest: "8000Mi" +juliaMemoryLimit: "12000Mi" \ No newline at end of file From 197772c24b4d772a76a49ec4eb7bec071ff483bf Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sat, 1 Apr 2023 15:39:07 -0600 Subject: [PATCH 13/92] Merge migrations --- job/migrations/0035_merge_20230401_2138.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 job/migrations/0035_merge_20230401_2138.py diff --git a/job/migrations/0035_merge_20230401_2138.py b/job/migrations/0035_merge_20230401_2138.py new file mode 100644 index 000000000..9808e6960 --- /dev/null +++ b/job/migrations/0035_merge_20230401_2138.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.7 on 2023-04-01 21:38 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0034_alter_financialinputs_value_of_lost_load_per_kwh_and_more'), + ('job', '0034_alter_windinputs_production_factor_series'), + ] + + operations = [ + ] From e1a103c95349f303cbfd2d56d7eb72eb9885ab54 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sat, 1 Apr 2023 15:56:51 -0600 Subject: [PATCH 14/92] Remove all CpuLimit per https://home.robusta.dev/blog/stop-using-cpu-limits --- .helm/templates/julia-deployment.yaml | 1 - .helm/values.production.yaml | 1 - .helm/values.staging.yaml | 3 +-- .helm/values.yaml | 3 --- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.helm/templates/julia-deployment.yaml b/.helm/templates/julia-deployment.yaml index d7a01b461..593a042a8 100644 --- a/.helm/templates/julia-deployment.yaml +++ b/.helm/templates/julia-deployment.yaml @@ -52,5 +52,4 @@ spec: cpu: {{ .Values.juliaCpuRequest | quote }} memory: {{ .Values.juliaMemoryRequest | quote }} limits: - cpu: {{ .Values.juliaCpuLimit | quote }} memory: {{ .Values.juliaMemoryLimit | quote }} diff --git a/.helm/values.production.yaml b/.helm/values.production.yaml index 7c028a0e3..7bfdda7b6 100644 --- a/.helm/values.production.yaml +++ b/.helm/values.production.yaml @@ -8,6 +8,5 @@ celeryMemoryRequest: "900Mi" celeryMemoryLimit: "900Mi" juliaReplicas: 20 juliaCpuRequest: "300m" -juliaCpuLimit: "4000m" juliaMemoryRequest: "8000Mi" juliaMemoryLimit: "8000Mi" diff --git a/.helm/values.staging.yaml b/.helm/values.staging.yaml index 1fc67a970..6f3f2419e 100644 --- a/.helm/values.staging.yaml +++ b/.helm/values.staging.yaml @@ -2,6 +2,5 @@ appEnv: staging djangoSettingsModule: reopt_api.staging_settings juliaReplicas: 2 juliaCpuRequest: "2000m" -juliaCpuLimit: "3000m" -juliaMemoryRequest: "8000Mi" +juliaMemoryRequest: "12000Mi" juliaMemoryLimit: "12000Mi" \ No newline at end of file diff --git a/.helm/values.yaml b/.helm/values.yaml index 5b3421e42..8ed9116fb 100644 --- a/.helm/values.yaml +++ b/.helm/values.yaml @@ -10,16 +10,13 @@ redisHost: "{{ .Chart.Name }}-redis-service" redisPort: 6379 djangoReplicas: 2 djangoCpuRequest: "100m" -djangoCpuLimit: "4000m" djangoMemoryRequest: "1600Mi" djangoMemoryLimit: "1600Mi" celeryReplicas: 2 celeryCpuRequest: "100m" -celeryCpuLimit: "800m" celeryMemoryRequest: "700Mi" celeryMemoryLimit: "700Mi" juliaReplicas: 2 juliaCpuRequest: "300m" -juliaCpuLimit: "4000m" juliaMemoryRequest: "3000Mi" juliaMemoryLimit: "3000Mi" From 4e7c14aa902472a6b6485eceb612ce34617765fa Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sat, 1 Apr 2023 16:15:25 -0600 Subject: [PATCH 15/92] Finish removing CpuLimits for celery and django --- .helm/templates/celery-deployment.yaml | 1 - .helm/templates/django-deployment.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/.helm/templates/celery-deployment.yaml b/.helm/templates/celery-deployment.yaml index 9aae80b9c..c72828356 100644 --- a/.helm/templates/celery-deployment.yaml +++ b/.helm/templates/celery-deployment.yaml @@ -77,5 +77,4 @@ spec: cpu: {{ .Values.celeryCpuRequest | quote }} memory: {{ .Values.celeryMemoryRequest | quote }} limits: - cpu: {{ .Values.celeryCpuLimit | quote }} memory: {{ .Values.celeryMemoryLimit | quote }} diff --git a/.helm/templates/django-deployment.yaml b/.helm/templates/django-deployment.yaml index 26a0d89a3..f891601f8 100644 --- a/.helm/templates/django-deployment.yaml +++ b/.helm/templates/django-deployment.yaml @@ -87,5 +87,4 @@ spec: cpu: {{ .Values.djangoCpuRequest | quote }} memory: {{ .Values.djangoMemoryRequest | quote }} limits: - cpu: {{ .Values.djangoCpuLimit | quote }} memory: {{ .Values.djangoMemoryLimit | quote }} From e3686a883499dea9a9b604395b1b9a750e2df83f Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 3 Apr 2023 15:37:30 -0400 Subject: [PATCH 16/92] update migration files --- ...boilerinputs_boileroutputs_steamturbineinputs_and_more.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename job/migrations/{0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py => 0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py} (99%) diff --git a/job/migrations/0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py b/job/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py similarity index 99% rename from job/migrations/0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py rename to job/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py index d491db83c..74bd396ce 100644 --- a/job/migrations/0026_boilerinputs_boileroutputs_steamturbineinputs_and_more.py +++ b/job/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 4.0.7 on 2023-03-07 20:31 +# Generated by Django 4.0.7 on 2023-04-03 19:19 import django.contrib.postgres.fields import django.core.validators @@ -10,7 +10,7 @@ class Migration(migrations.Migration): dependencies = [ - ('job', '0025_merge_20230202_1907'), + ('job', '0034_alter_financialinputs_value_of_lost_load_per_kwh_and_more'), ] operations = [ From d69df5b45ab4007932641c5d2dad3107e9190fe1 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 08:32:54 -0600 Subject: [PATCH 17/92] Change Julia env in Dockerfile to non-threaded (1) --- julia_src/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/Dockerfile b/julia_src/Dockerfile index 828ba9a49..cffae2e32 100644 --- a/julia_src/Dockerfile +++ b/julia_src/Dockerfile @@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y \ gfortran # Install Julia packages -ENV JULIA_NUM_THREADS=2 +ENV JULIA_NUM_THREADS=1 WORKDIR /opt/julia_src/ COPY . . RUN julia --project="." -e 'import Pkg; Pkg.instantiate();' From f32c54f31dd56824c94482980339bed9da536ad5 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 08:33:42 -0600 Subject: [PATCH 18/92] Revert staging settings, back to use values.yaml --- .helm/values.staging.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.helm/values.staging.yaml b/.helm/values.staging.yaml index 6f3f2419e..d7cfc7107 100644 --- a/.helm/values.staging.yaml +++ b/.helm/values.staging.yaml @@ -1,6 +1,2 @@ appEnv: staging -djangoSettingsModule: reopt_api.staging_settings -juliaReplicas: 2 -juliaCpuRequest: "2000m" -juliaMemoryRequest: "12000Mi" -juliaMemoryLimit: "12000Mi" \ No newline at end of file +djangoSettingsModule: reopt_api.staging_settings \ No newline at end of file From 7bb1ddbe46709c997fbffa281b1a180cc688f47f Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 08:33:58 -0600 Subject: [PATCH 19/92] Temp change REopt.jl version to series-option branch --- julia_src/Manifest.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index d16f856fc..81bf766ca 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -734,7 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "dc83e43976297b559efa58f8192d8d8ed75ce77a" +git-tree-sha1 = "eea9b45e2781a0adc4cb36bd918d0145d04e98e5" +repo-rev = "series-option" +repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" version = "0.30.0" From 1d86a3f3150ac4165fa3abc728614617ab6c6538 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 08:37:07 -0600 Subject: [PATCH 20/92] Add threads kwarg to run_reopt For run_bau=false, don't send argument --- julia_src/http.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 88bf2a8d6..4cce74fd5 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -82,7 +82,11 @@ function reopt(req::HTTP.Request) else # Catch handled/unhandled exceptions in optimization try - results = reoptjl.run_reopt(ms, model_inputs) + if run_bau + results = reoptjl.run_reopt(ms, model_inputs, threads=false) + else + results = reoptjl.run_reopt(ms, model_inputs) + end inputs_with_defaults_from_easiur = [ :NOx_grid_cost_per_tonne, :SO2_grid_cost_per_tonne, :PM25_grid_cost_per_tonne, :NOx_onsite_fuelburn_cost_per_tonne, :SO2_onsite_fuelburn_cost_per_tonne, :PM25_onsite_fuelburn_cost_per_tonne, From 64deda3739413266d6f9d0a584ce00e6c174c178 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 12:51:29 -0600 Subject: [PATCH 21/92] Fix REopt_Lite_API -> REopt_API name change error --- Jenkinsfile-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-deploy b/Jenkinsfile-deploy index 0a9f4780b..ec9fed809 100644 --- a/Jenkinsfile-deploy +++ b/Jenkinsfile-deploy @@ -45,7 +45,7 @@ pipeline { stages { stage("checkout-deploy-branch") { steps { - tadaCheckoutDeployBranch("https://github.com/NREL/REopt_Lite.git") + tadaCheckoutDeployBranch("https://github.com/NREL/REopt_API.git") } } From 2c6dae3fff0a71649570c5b8642e3c2bc74b38f3 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 12:59:33 -0600 Subject: [PATCH 22/92] Revert "Remove all CpuLimit per https://home.robusta.dev/blog/stop-using-cpu-limits" This reverts commit e1a103c95349f303cbfd2d56d7eb72eb9885ab54. --- .helm/templates/julia-deployment.yaml | 1 + .helm/values.production.yaml | 1 + .helm/values.staging.yaml | 2 +- .helm/values.yaml | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.helm/templates/julia-deployment.yaml b/.helm/templates/julia-deployment.yaml index 593a042a8..d7a01b461 100644 --- a/.helm/templates/julia-deployment.yaml +++ b/.helm/templates/julia-deployment.yaml @@ -52,4 +52,5 @@ spec: cpu: {{ .Values.juliaCpuRequest | quote }} memory: {{ .Values.juliaMemoryRequest | quote }} limits: + cpu: {{ .Values.juliaCpuLimit | quote }} memory: {{ .Values.juliaMemoryLimit | quote }} diff --git a/.helm/values.production.yaml b/.helm/values.production.yaml index 7bfdda7b6..7c028a0e3 100644 --- a/.helm/values.production.yaml +++ b/.helm/values.production.yaml @@ -8,5 +8,6 @@ celeryMemoryRequest: "900Mi" celeryMemoryLimit: "900Mi" juliaReplicas: 20 juliaCpuRequest: "300m" +juliaCpuLimit: "4000m" juliaMemoryRequest: "8000Mi" juliaMemoryLimit: "8000Mi" diff --git a/.helm/values.staging.yaml b/.helm/values.staging.yaml index d7cfc7107..4c3eddde0 100644 --- a/.helm/values.staging.yaml +++ b/.helm/values.staging.yaml @@ -1,2 +1,2 @@ appEnv: staging -djangoSettingsModule: reopt_api.staging_settings \ No newline at end of file +djangoSettingsModule: reopt_api.staging_settings diff --git a/.helm/values.yaml b/.helm/values.yaml index 8ed9116fb..5b3421e42 100644 --- a/.helm/values.yaml +++ b/.helm/values.yaml @@ -10,13 +10,16 @@ redisHost: "{{ .Chart.Name }}-redis-service" redisPort: 6379 djangoReplicas: 2 djangoCpuRequest: "100m" +djangoCpuLimit: "4000m" djangoMemoryRequest: "1600Mi" djangoMemoryLimit: "1600Mi" celeryReplicas: 2 celeryCpuRequest: "100m" +celeryCpuLimit: "800m" celeryMemoryRequest: "700Mi" celeryMemoryLimit: "700Mi" juliaReplicas: 2 juliaCpuRequest: "300m" +juliaCpuLimit: "4000m" juliaMemoryRequest: "3000Mi" juliaMemoryLimit: "3000Mi" From e473853a77e34cd541de47dd510b25a7d463747b Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 12:59:47 -0600 Subject: [PATCH 23/92] Revert "Finish removing CpuLimits for celery and django" This reverts commit 4e7c14aa902472a6b6485eceb612ce34617765fa. --- .helm/templates/celery-deployment.yaml | 1 + .helm/templates/django-deployment.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.helm/templates/celery-deployment.yaml b/.helm/templates/celery-deployment.yaml index c72828356..9aae80b9c 100644 --- a/.helm/templates/celery-deployment.yaml +++ b/.helm/templates/celery-deployment.yaml @@ -77,4 +77,5 @@ spec: cpu: {{ .Values.celeryCpuRequest | quote }} memory: {{ .Values.celeryMemoryRequest | quote }} limits: + cpu: {{ .Values.celeryCpuLimit | quote }} memory: {{ .Values.celeryMemoryLimit | quote }} diff --git a/.helm/templates/django-deployment.yaml b/.helm/templates/django-deployment.yaml index f891601f8..26a0d89a3 100644 --- a/.helm/templates/django-deployment.yaml +++ b/.helm/templates/django-deployment.yaml @@ -87,4 +87,5 @@ spec: cpu: {{ .Values.djangoCpuRequest | quote }} memory: {{ .Values.djangoMemoryRequest | quote }} limits: + cpu: {{ .Values.djangoCpuLimit | quote }} memory: {{ .Values.djangoMemoryLimit | quote }} From e54fe9e61455215e73bdec4b3da5b978616b7388 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 11 Apr 2023 22:19:35 -0600 Subject: [PATCH 24/92] Update REopt.jl series-option branch for PVWatts logging --- julia_src/Manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 81bf766ca..cd78011b3 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -734,7 +734,7 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "eea9b45e2781a0adc4cb36bd918d0145d04e98e5" +git-tree-sha1 = "1be82fdfe767c21434285eb10f4f80b88f465728" repo-rev = "series-option" repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" From dedb8e9a5bf51c9f8a1ede1bfa5df41780f7b704 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 12 Apr 2023 10:26:39 -0600 Subject: [PATCH 25/92] Update HTTP.jl from 0.9 to 1.7 --- julia_src/Manifest.toml | 97 ++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 60 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index cd78011b3..b288f99ec 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -50,6 +50,11 @@ git-tree-sha1 = "d9a9701b899b30332bbcb3e1679c41cce81fb0e8" uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" version = "1.3.2" +[[deps.BitFlags]] +git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.7" + [[deps.Blosc]] deps = ["Blosc_jll"] git-tree-sha1 = "310b77648d38c223d947ff3f50f511d08690b8d5" @@ -210,13 +215,9 @@ version = "1.13.0" [[deps.DiskArrays]] deps = ["OffsetArrays"] -git-tree-sha1 = "3f87990e0882e44c0f4e5c9699d09a0edbfa25c8" +git-tree-sha1 = "6d5b17f84cffa44a1933b50997927fe109039abc" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" -version = "0.3.9" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" +version = "0.3.10" [[deps.DocStringExtensions]] deps = ["LibGit2"] @@ -246,12 +247,6 @@ git-tree-sha1 = "7be5f99f7d15578798f338f5433b6c432ea8037b" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" version = "1.16.0" -[[deps.FilePaths]] -deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"] -git-tree-sha1 = "919d9412dbf53a2e6fe74af62a73ceed0bce0629" -uuid = "8fc22ac5-c921-52a6-82fd-178b2807b824" -version = "0.8.3" - [[deps.FilePathsBase]] deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"] git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12" @@ -325,11 +320,6 @@ repo-url = "https://github.com/NREL/GhpGhx.jl.git" uuid = "7ce85f02-24a8-4d69-a3f0-14b5daa7d30c" version = "0.1.0" -[[deps.Glob]] -git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" -uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" -version = "1.3.1" - [[deps.Graphics]] deps = ["Colors", "LinearAlgebra", "NaNMath"] git-tree-sha1 = "d61890399bc535850c4bf08e4e0d3a7ad0f21cbd" @@ -355,10 +345,10 @@ uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" version = "1.12.2+2" [[deps.HTTP]] -deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"] -git-tree-sha1 = "0fa77022fe4b511826b39c894c90daf5fce3334a" +deps = ["Base64", "CodecZlib", "Dates", "IniFile", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "37e4657cd56b11abe3d10cd4a1ec5fbdb4180263" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.9.17" +version = "1.7.4" [[deps.ImageCore]] deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] @@ -366,12 +356,6 @@ git-tree-sha1 = "acf614720ef026d38400b3817614c45882d75500" uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" version = "0.9.4" -[[deps.InfrastructureModels]] -deps = ["JuMP", "Memento"] -git-tree-sha1 = "dc1e2eba1a98aa457b629fe1723d9078ecb74340" -uuid = "2030c09a-7f63-5d83-885d-db604e0e9cc0" -version = "0.7.7" - [[deps.IniFile]] git-tree-sha1 = "f550e6e32074c939295eb5ea6de31849ac2c9625" uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" @@ -513,10 +497,10 @@ uuid = "89763e89-9b03-5906-acba-b20f662cd828" version = "4.4.0+0" [[deps.LinDistFlow]] -deps = ["JuMP", "LinearAlgebra", "PowerModelsDistribution", "SparseArrays"] -git-tree-sha1 = "c6c652ab975386cab61559e4ac861e8f75932e94" +deps = ["JuMP", "LinearAlgebra", "Logging", "SparseArrays"] +git-tree-sha1 = "ad15878e716a18b82325cacc02af4533bb9777e7" uuid = "bf674bac-ffe4-48d3-9f32-72124ffa9ede" -version = "0.2.0" +version = "0.1.4" [[deps.LinearAlgebra]] deps = ["Libdl", "libblastrampoline_jll"] @@ -539,9 +523,9 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.LoggingExtras]] deps = ["Dates", "Logging"] -git-tree-sha1 = "5d4d2d9904227b8bd66386c1138cf4d5ffa826bf" +git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" -version = "0.4.9" +version = "1.0.0" [[deps.Lz4_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -581,12 +565,6 @@ deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" version = "2.28.0+0" -[[deps.Memento]] -deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"] -git-tree-sha1 = "bb2e8f4d9f400f6e90d57b34860f6abdc51398e5" -uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" -version = "1.4.1" - [[deps.Missings]] deps = ["DataAPI"] git-tree-sha1 = "f66bdc5de519e8f8ae43bdc598782d35a25b1272" @@ -650,6 +628,12 @@ deps = ["Artifacts", "Libdl"] uuid = "05823500-19ac-5b8b-9628-191a04bc5112" version = "0.8.1+0" +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "e9d68fe4b5f78f215aa2f0e6e6dc9e9911d33048" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.3.4" + [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "9ff31d101d987eb9d66bd8b176ac7c277beccd09" @@ -663,9 +647,9 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.5+0" [[deps.OrderedCollections]] -git-tree-sha1 = "d78db6df34313deaca15c5c0b9ff562c704fe1ab" +git-tree-sha1 = "d321bf2de576bf25ec4d3e4360faca399afca282" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.5.0" +version = "1.6.0" [[deps.PROJ_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Libtiff_jll", "Pkg", "SQLite_jll"] @@ -675,9 +659,9 @@ version = "900.100.0+0" [[deps.PaddedViews]] deps = ["OffsetArrays"] -git-tree-sha1 = "03a7a85b76381a3d04c7a1656039197e70eda03d" +git-tree-sha1 = "0fac6313486baae819364c52b4f483450a9d793f" uuid = "5432bcbf-9aad-5242-b902-cca2824c8663" -version = "0.5.11" +version = "0.5.12" [[deps.Parsers]] deps = ["Dates", "SnoopPrecompile"] @@ -690,24 +674,12 @@ deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markd uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" version = "1.8.0" -[[deps.PolyhedralRelaxations]] -deps = ["DataStructures", "ForwardDiff", "JuMP", "Logging", "LoggingExtras"] -git-tree-sha1 = "05f2adc696ae9a99be3de99dd8970d00a4dccefe" -uuid = "2e741578-48fa-11ea-2d62-b52c946f73a0" -version = "0.3.5" - [[deps.PooledArrays]] deps = ["DataAPI", "Future"] git-tree-sha1 = "a6062fe4063cdafe78f4a0a81cfffb89721b30e7" uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" version = "1.4.2" -[[deps.PowerModelsDistribution]] -deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "fd2a5efc06acb1b449a985c48d4b3d8004a3b371" -uuid = "d7431456-977f-11e9-2de3-97ff7677985e" -version = "0.14.7" - [[deps.Preferences]] deps = ["TOML"] git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d" @@ -734,7 +706,7 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "1be82fdfe767c21434285eb10f4f80b88f465728" +git-tree-sha1 = "20977128a1b664dd979ba1e9423f7891cc5f2b0d" repo-rev = "series-option" repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" @@ -797,6 +769,11 @@ git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" version = "1.1.1" +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + [[deps.SnoopPrecompile]] deps = ["Preferences"] git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" @@ -894,9 +871,9 @@ version = "0.16.0+0" [[deps.TranscodingStreams]] deps = ["Random", "Test"] -git-tree-sha1 = "94f38103c984f89cf77c402f2a68dbd870f8165f" +git-tree-sha1 = "0b829474fed270a4b0ab07117dce9b9a2fa7581a" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.11" +version = "0.9.12" [[deps.URIs]] git-tree-sha1 = "074f993b0ca030848b897beff716d93aca60f06a" @@ -912,9 +889,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "bb37ed24f338bc59b83e3fc9f32dd388e5396c53" +git-tree-sha1 = "823d8c0d0955aa6df3f715067ec4536562f42912" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.12.4" +version = "1.13.0" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] @@ -946,9 +923,9 @@ version = "1.2.12+3" [[deps.Zstd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "c6edfe154ad7b313c01aceca188c05c835c67360" +git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c" uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.4+0" +version = "1.5.5+0" [[deps.boost_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] From 69b42304159ef284720c572a0c27b025492fe3a6 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 12 Apr 2023 16:51:14 -0600 Subject: [PATCH 26/92] Change @register to register! for updated HTTP.jl --- julia_src/http.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 4cce74fd5..38529afc6 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -289,12 +289,12 @@ end # define REST endpoints to dispatch to "service" functions const ROUTER = HTTP.Router() -HTTP.@register(ROUTER, "POST", "/job", job) -HTTP.@register(ROUTER, "POST", "/reopt", reopt) -HTTP.@register(ROUTER, "POST", "/erp", erp) -HTTP.@register(ROUTER, "POST", "/ghpghx", ghpghx) -HTTP.@register(ROUTER, "GET", "/chp_defaults", chp_defaults) -HTTP.@register(ROUTER, "GET", "/emissions_profile", emissions_profile) -HTTP.@register(ROUTER, "GET", "/simulated_load", simulated_load) -HTTP.@register(ROUTER, "GET", "/health", health) +HTTP.register!(ROUTER, "POST", "/job", job) +HTTP.register!(ROUTER, "POST", "/reopt", reopt) +HTTP.register!(ROUTER, "POST", "/erp", erp) +HTTP.register!(ROUTER, "POST", "/ghpghx", ghpghx) +HTTP.register!(ROUTER, "GET", "/chp_defaults", chp_defaults) +HTTP.register!(ROUTER, "GET", "/emissions_profile", emissions_profile) +HTTP.register!(ROUTER, "GET", "/simulated_load", simulated_load) +HTTP.register!(ROUTER, "GET", "/health", health) HTTP.serve(ROUTER, "0.0.0.0", 8081, reuseaddr=true) From fc4f3de048918556320346411a10224944eb35b0 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 12 Apr 2023 21:36:15 -0600 Subject: [PATCH 27/92] Update REopt#series-option --- julia_src/Manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index b288f99ec..ac9ccf8d5 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -706,7 +706,7 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "20977128a1b664dd979ba1e9423f7891cc5f2b0d" +git-tree-sha1 = "9c96890097b91721102c5691f2a4b9f77849d9fc" repo-rev = "series-option" repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" From 1be473416ba7db70e3d6642dad57b5e82c6e208a Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 12 Apr 2023 22:47:45 -0600 Subject: [PATCH 28/92] Update REopt#series-option for less PVWatts logging --- julia_src/Manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index ac9ccf8d5..62f136463 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -706,7 +706,7 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "9c96890097b91721102c5691f2a4b9f77849d9fc" +git-tree-sha1 = "c4db920695e835ed7dad7e968c18101856d821a3" repo-rev = "series-option" repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" From b5068d76c42e8cd8045162ebdca233fd1aaeadba Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Wed, 12 Apr 2023 22:55:38 -0600 Subject: [PATCH 29/92] Change JULIA_NUM_THREADS back to 2 in Dockerfile --- julia_src/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/Dockerfile b/julia_src/Dockerfile index cffae2e32..828ba9a49 100644 --- a/julia_src/Dockerfile +++ b/julia_src/Dockerfile @@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y \ gfortran # Install Julia packages -ENV JULIA_NUM_THREADS=1 +ENV JULIA_NUM_THREADS=2 WORKDIR /opt/julia_src/ COPY . . RUN julia --project="." -e 'import Pkg; Pkg.instantiate();' From a4fccce786a92eba0e6085a2afed29b5153e5693 Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Wed, 12 Apr 2023 22:58:40 -0600 Subject: [PATCH 30/92] Change run_reopt back to use Threads --- julia_src/http.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 44c64e9d0..0c24ff3d4 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -83,7 +83,7 @@ function reopt(req::HTTP.Request) # Catch handled/unhandled exceptions in optimization try if run_bau - results = reoptjl.run_reopt(ms, model_inputs, threads=false) + results = reoptjl.run_reopt(ms, model_inputs, threads=true) else results = reoptjl.run_reopt(ms, model_inputs) end From 24e8fbdd807d0d6ca9baf571e76e6ff160986710 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 12 Apr 2023 23:04:39 -0600 Subject: [PATCH 31/92] Merge migrations after merging develop --- job/migrations/0036_merge_20230413_0504.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 job/migrations/0036_merge_20230413_0504.py diff --git a/job/migrations/0036_merge_20230413_0504.py b/job/migrations/0036_merge_20230413_0504.py new file mode 100644 index 000000000..aa7373589 --- /dev/null +++ b/job/migrations/0036_merge_20230413_0504.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.7 on 2023-04-13 05:04 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0035_merge_20230401_2138'), + ('job', '0035_merge_20230406_1415'), + ] + + operations = [ + ] From 29192e40cc6bdd465acefff408e9fa4b4b6d0cda Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 13 Apr 2023 09:05:09 -0600 Subject: [PATCH 32/92] Update REopt.jl#series-option for keepalive=true, no request logging --- julia_src/Manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 62f136463..6d81185fe 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -706,7 +706,7 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "c4db920695e835ed7dad7e968c18101856d821a3" +git-tree-sha1 = "44f650eee5249088e0a8696857cf94fe9d2dac28" repo-rev = "series-option" repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" From 102f86a694ce75afb3f720ec820378ccc5ea304c Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 13 Apr 2023 09:05:39 -0600 Subject: [PATCH 33/92] Increase staging Julia compute resources to 1 CPU, 8GB --- .helm/values.staging.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.helm/values.staging.yaml b/.helm/values.staging.yaml index 4c3eddde0..78b346218 100644 --- a/.helm/values.staging.yaml +++ b/.helm/values.staging.yaml @@ -1,2 +1,6 @@ appEnv: staging djangoSettingsModule: reopt_api.staging_settings +juliaCpuRequest: "1000m" +juliaCpuLimit: "4000m" +juliaMemoryRequest: "8000Mi" +juliaMemoryLimit: "8000Mi" \ No newline at end of file From 80341baa7c51a66f13b99f88616b42a15c234de1 Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Thu, 20 Apr 2023 14:01:53 -0600 Subject: [PATCH 34/92] point to latest reopt and remove threads arg --- julia_src/Manifest.toml | 22 ++++++++++------------ julia_src/http.jl | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 6d81185fe..65533b363 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -630,9 +630,9 @@ version = "0.8.1+0" [[deps.OpenSSL]] deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] -git-tree-sha1 = "e9d68fe4b5f78f215aa2f0e6e6dc9e9911d33048" +git-tree-sha1 = "5b3e170ea0724f1e3ed6018c5b006c190f80e87d" uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" -version = "1.3.4" +version = "1.3.5" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -706,11 +706,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "44f650eee5249088e0a8696857cf94fe9d2dac28" -repo-rev = "series-option" -repo-url = "https://github.com/NREL/REopt.jl.git" +git-tree-sha1 = "581389fc41858488802c0e2fb524ee7a20c589e0" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.30.0" +version = "0.31.0" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -740,9 +738,9 @@ version = "1.3.0" [[deps.Roots]] deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "b45deea4566988994ebb8fb80aa438a295995a6e" +git-tree-sha1 = "82362f2a4f756951f21ebb3ac2aed094c46a5109" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.10" +version = "2.0.12" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -807,9 +805,9 @@ version = "0.1.1" [[deps.StaticArrays]] deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "b8d897fe7fa688e93aef573711cb207c08c9e11e" +git-tree-sha1 = "63e84b7fdf5021026d0f17f76af7c57772313d99" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.19" +version = "1.5.21" [[deps.StaticArraysCore]] git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" @@ -889,9 +887,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "823d8c0d0955aa6df3f715067ec4536562f42912" +git-tree-sha1 = "dba3eba51b9512695b59e0bd8263ac074c5ed2d9" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.13.0" +version = "1.13.1" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] diff --git a/julia_src/http.jl b/julia_src/http.jl index 0c24ff3d4..963aa0440 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -83,7 +83,7 @@ function reopt(req::HTTP.Request) # Catch handled/unhandled exceptions in optimization try if run_bau - results = reoptjl.run_reopt(ms, model_inputs, threads=true) + results = reoptjl.run_reopt(ms, model_inputs) else results = reoptjl.run_reopt(ms, model_inputs) end From 410bd7ff69b81ac2fda159ea9d55b2d3ada329b8 Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Thu, 20 Apr 2023 14:24:46 -0600 Subject: [PATCH 35/92] Update test_job_endpoint.py --- job/test/test_job_endpoint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/job/test/test_job_endpoint.py b/job/test/test_job_endpoint.py index 90a7e196b..0f3afc9e8 100644 --- a/job/test/test_job_endpoint.py +++ b/job/test/test_job_endpoint.py @@ -43,7 +43,6 @@ class TestJobEndpoint(ResourceTestCaseMixin, TransactionTestCase): - def test_multiple_outages(self): scenario_file = os.path.join('job', 'test', 'posts', 'outage.json') @@ -56,6 +55,8 @@ def test_multiple_outages(self): r = json.loads(resp.content) results = r["outputs"] self.assertEqual(np.array(results["Outages"]["unserved_load_series_kw"]).shape, (1,2,5)) + self.assertEqual(np.array(results["Outages"]["generator_fuel_used_per_outage_gal"]).shape, (1,2)) + self.assertEqual(np.array(results["Outages"]["chp_fuel_used_per_outage_mmbtu"]).shape, (1,2)) self.assertAlmostEqual(results["Outages"]["expected_outage_cost"], 0.0, places=-2) self.assertAlmostEqual(sum(sum(np.array(results["Outages"]["unserved_load_per_outage_kwh"]))), 0.0, places=0) self.assertAlmostEqual(results["Outages"]["microgrid_upgrade_capital_cost"], 1927766, places=-2) From b53ae3fd47f38afac39ad40feb41996b71d98f67 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 21 Apr 2023 12:17:46 -0600 Subject: [PATCH 36/92] Revert "Add threads kwarg to run_reopt" This reverts commit 1d86a3f3150ac4165fa3abc728614617ab6c6538. --- julia_src/http.jl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 0c24ff3d4..cc42fe0fe 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -82,11 +82,7 @@ function reopt(req::HTTP.Request) else # Catch handled/unhandled exceptions in optimization try - if run_bau - results = reoptjl.run_reopt(ms, model_inputs, threads=true) - else - results = reoptjl.run_reopt(ms, model_inputs) - end + results = reoptjl.run_reopt(ms, model_inputs) inputs_with_defaults_from_easiur = [ :NOx_grid_cost_per_tonne, :SO2_grid_cost_per_tonne, :PM25_grid_cost_per_tonne, :NOx_onsite_fuelburn_cost_per_tonne, :SO2_onsite_fuelburn_cost_per_tonne, :PM25_onsite_fuelburn_cost_per_tonne, From 9f0892efed139ff8a769144efb640977745a2f53 Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Fri, 5 May 2023 13:41:55 -0600 Subject: [PATCH 37/92] Create 0037_merge_20230505_1941.py --- job/migrations/0037_merge_20230505_1941.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 job/migrations/0037_merge_20230505_1941.py diff --git a/job/migrations/0037_merge_20230505_1941.py b/job/migrations/0037_merge_20230505_1941.py new file mode 100644 index 000000000..0d3908b4d --- /dev/null +++ b/job/migrations/0037_merge_20230505_1941.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.4 on 2023-05-05 19:41 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0036_merge_20230413_0504'), + ('job', '0036_merge_20230424_1645'), + ] + + operations = [ + ] From e67ade126c83d446030c51381ba39f81d8ec59af Mon Sep 17 00:00:00 2001 From: hdunham <70401017+hdunham@users.noreply.github.com> Date: Mon, 8 May 2023 07:22:52 -0600 Subject: [PATCH 38/92] correct merge mistake --- julia_src/http.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 3a743beb7..86e79d0ad 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -350,14 +350,14 @@ end # define REST endpoints to dispatch to "service" functions const ROUTER = HTTP.Router() -HTTP.@register(ROUTER, "POST", "/job", job) -HTTP.@register(ROUTER, "POST", "/reopt", reopt) -HTTP.@register(ROUTER, "POST", "/erp", erp) -HTTP.@register(ROUTER, "POST", "/ghpghx", ghpghx) -HTTP.@register(ROUTER, "GET", "/chp_defaults", chp_defaults) -HTTP.@register(ROUTER, "GET", "/emissions_profile", emissions_profile) -HTTP.@register(ROUTER, "GET", "/easiur_costs", easiur_costs) -HTTP.@register(ROUTER, "GET", "/simulated_load", simulated_load) -HTTP.@register(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller_defaults) -HTTP.@register(ROUTER, "GET", "/health", health) +HTTP.register!(ROUTER, "POST", "/job", job) +HTTP.register!(ROUTER, "POST", "/reopt", reopt) +HTTP.register!(ROUTER, "POST", "/erp", erp) +HTTP.register!(ROUTER, "POST", "/ghpghx", ghpghx) +HTTP.register!(ROUTER, "GET", "/chp_defaults", chp_defaults) +HTTP.register!(ROUTER, "GET", "/emissions_profile", emissions_profile) +HTTP.register!(ROUTER, "GET", "/easiur_costs", easiur_costs) +HTTP.register!(ROUTER, "GET", "/simulated_load", simulated_load) +HTTP.register!(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller_defaults) +HTTP.register!(ROUTER, "GET", "/health", health) HTTP.serve(ROUTER, "0.0.0.0", 8081, reuseaddr=true) From a791a0a5146a5c00d689c4fce9a974b795ac4c03 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sun, 4 Jun 2023 23:07:44 -0600 Subject: [PATCH 39/92] Merge migrations after merging develop --- job/migrations/0037_merge_20230605_0505.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 job/migrations/0037_merge_20230605_0505.py diff --git a/job/migrations/0037_merge_20230605_0505.py b/job/migrations/0037_merge_20230605_0505.py new file mode 100644 index 000000000..d7276a026 --- /dev/null +++ b/job/migrations/0037_merge_20230605_0505.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.7 on 2023-06-05 05:05 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0035_boilerinputs_boileroutputs_steamturbineinputs_and_more'), + ('job', '0036_merge_20230424_1645'), + ] + + operations = [ + ] From 8d7686377c4acd4e7a06b3057f880d137c2e921e Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 5 Jun 2023 09:42:35 -0600 Subject: [PATCH 40/92] Align test_chp_defaults with latest version of REopt.jl We changed CHP defaults in REopt.jl to align with v2, with size_class 0 being the first size_class again --- job/test/test_http_endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/job/test/test_http_endpoints.py b/job/test/test_http_endpoints.py index 328a362b2..171fcf6f8 100644 --- a/job/test/test_http_endpoints.py +++ b/job/test/test_http_endpoints.py @@ -44,7 +44,7 @@ def test_chp_defaults(self): } resp = self.api_client.get(f'/v2/chp_defaults', data=inputs_v2) v2_response = json.loads(resp.content) - self.assertEqual(http_response["size_class"], v2_response["size_class"]+1) + self.assertEqual(http_response["size_class"], v2_response["size_class"]) def test_steamturbine_defaults(self): From fe47e92c24104086dfb9626b6938d4ab6e33d76c Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 5 Jun 2023 20:58:17 -0600 Subject: [PATCH 41/92] Add can_supply_steam_turbine for ExistingBoiler --- ...ingboilerinputs_can_supply_steam_turbine.py | 18 ++++++++++++++++++ job/models.py | 12 ++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 job/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py diff --git a/job/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py b/job/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py new file mode 100644 index 000000000..2ed29ed78 --- /dev/null +++ b/job/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.7 on 2023-06-06 02:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0037_merge_20230605_0505'), + ] + + operations = [ + migrations.AddField( + model_name='existingboilerinputs', + name='can_supply_steam_turbine', + field=models.BooleanField(blank=True, default=False, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True), + ), + ] diff --git a/job/models.py b/job/models.py index b866f81aa..15b988321 100644 --- a/job/models.py +++ b/job/models.py @@ -4672,12 +4672,12 @@ class ExistingBoilerInputs(BaseModel, models.Model): help_text="Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil" ) - # can_supply_steam_turbine = models.BooleanField( - # default=False, - # blank=True, - # null=True, - # help_text="If the boiler can supply steam to the steam turbine for electric production" - # ) + can_supply_steam_turbine = models.BooleanField( + default=False, + blank=True, + null=True, + help_text="If the boiler can supply steam to the steam turbine for electric production" + ) # For custom validations within model. def clean(self): From 996ba33eecc5f07550c4e64af3de29f02ec9906a Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 5 Jun 2023 21:14:21 -0600 Subject: [PATCH 42/92] Add [tech]_fuel_escalation_rate_fraction For Generator, ExistingBoiler, Boiler, and CHP --- ..._fuel_escalation_rate_fraction_and_more.py | 34 ++++++++++++ job/models.py | 55 ++++++++++++------- 2 files changed, 70 insertions(+), 19 deletions(-) create mode 100644 job/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py diff --git a/job/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py b/job/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py new file mode 100644 index 000000000..9defacf94 --- /dev/null +++ b/job/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py @@ -0,0 +1,34 @@ +# Generated by Django 4.0.7 on 2023-06-06 03:13 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0038_existingboilerinputs_can_supply_steam_turbine'), + ] + + operations = [ + migrations.AddField( + model_name='financialinputs', + name='boiler_fuel_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), + migrations.AddField( + model_name='financialinputs', + name='chp_fuel_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal chp fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), + migrations.AddField( + model_name='financialinputs', + name='existing_boiler_fuel_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal existing boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), + migrations.AddField( + model_name='financialinputs', + name='generator_fuel_cost_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.027, help_text='Annual nominal boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), + ] diff --git a/job/models.py b/job/models.py index 15b988321..ed3fffdb3 100644 --- a/job/models.py +++ b/job/models.py @@ -818,25 +818,42 @@ class FinancialInputs(BaseModel, models.Model): null=True, help_text=("Annual nominal escalation rate of the public health cost of 1 tonne of PM2.5 emissions (as a decimal). The default value is calculated from the EASIUR model for a height of 150m.") ) - - # boiler_fuel_escalation_rate_fraction = models.FloatField( - # default=0.034, - # validators=[ - # MinValueValidator(-1), - # MaxValueValidator(1) - # ], - # blank=True, - # help_text=("Annual nominal boiler fuel cost escalation rate") - # ) - # chp_fuel_escalation_rate_fraction = models.FloatField( - # default=0.034, - # validators=[ - # MinValueValidator(-1), - # MaxValueValidator(1) - # ], - # blank=True, - # help_text=("Annual nominal chp fuel cost escalation rate") - # ) + generator_fuel_cost_escalation_rate_fraction = models.FloatField( + default=0.027, + validators=[ + MinValueValidator(-1), + MaxValueValidator(1) + ], + blank=True, + help_text=("Annual nominal boiler fuel cost escalation rate") + ) + existing_boiler_fuel_escalation_rate_fraction = models.FloatField( + default=0.034, + validators=[ + MinValueValidator(-1), + MaxValueValidator(1) + ], + blank=True, + help_text=("Annual nominal existing boiler fuel cost escalation rate") + ) + boiler_fuel_escalation_rate_fraction = models.FloatField( + default=0.034, + validators=[ + MinValueValidator(-1), + MaxValueValidator(1) + ], + blank=True, + help_text=("Annual nominal boiler fuel cost escalation rate") + ) + chp_fuel_escalation_rate_fraction = models.FloatField( + default=0.034, + validators=[ + MinValueValidator(-1), + MaxValueValidator(1) + ], + blank=True, + help_text=("Annual nominal chp fuel cost escalation rate") + ) def clean(self): if not self.third_party_ownership: From 97341bc58198924e8c63d05d69892af1dbac9fa1 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 5 Jun 2023 21:15:13 -0600 Subject: [PATCH 43/92] Temp switch REopt.jl to #boiler_stmturbine_debug branch --- julia_src/Manifest.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 22c7cec80..15c498253 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -734,9 +734,11 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "087e8a465ab8693ba98e6a20234b3e863bdf7f26" +git-tree-sha1 = "2a15951c97fa21f48c5060be7b204d7c775147c7" +repo-rev = "boiler_stmturbine_debug" +repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.1" +version = "0.32.2" [[deps.Random]] deps = ["SHA", "Serialization"] From 6c9b35da7a0f63a1978e0950083c038841d70d81 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 5 Jun 2023 22:01:33 -0600 Subject: [PATCH 44/92] Remove /steamturbine_defaults, combine with /chp_defaults --- job/models.py | 2 +- job/test/test_http_endpoints.py | 11 ++++--- job/urls.py | 1 - job/views.py | 26 ---------------- julia_src/http.jl | 54 ++++++--------------------------- 5 files changed, 16 insertions(+), 78 deletions(-) diff --git a/job/models.py b/job/models.py index ed3fffdb3..7ab3142f8 100644 --- a/job/models.py +++ b/job/models.py @@ -5023,7 +5023,7 @@ class SIZE_CLASS_LIST(models.IntegerChoices): help_text="Maximum steam turbine size constraint for optimization" ) - ## default values for these fields is determined via steamturbine_defaults returned from REoptInputs() call in http.jl + ## default values for these fields are returned from REoptInputs() call in http.jl size_class = models.IntegerField( null=True, choices=SIZE_CLASS_LIST.choices, diff --git a/job/test/test_http_endpoints.py b/job/test/test_http_endpoints.py index 171fcf6f8..9d7b164b9 100644 --- a/job/test/test_http_endpoints.py +++ b/job/test/test_http_endpoints.py @@ -49,16 +49,17 @@ def test_chp_defaults(self): def test_steamturbine_defaults(self): inputs = { + "prime_mover": "steam_turbine", "avg_boiler_fuel_load_mmbtu_per_hour": 28.0 } - # Direct call of the http.jl endpoint /steamturbine_defaults + # Direct call of the http.jl endpoint /chp_defaults julia_host = os.environ.get('JULIA_HOST', "julia") - response = requests.get("http://" + julia_host + ":8081/steamturbine_defaults/", json=inputs) + response = requests.get("http://" + julia_host + ":8081/chp_defaults/", json=inputs) http_response = response.json() - # Call to the django view endpoint /steamturbine_defaults which calls the http.jl endpoint - resp = self.api_client.get(f'/dev/steamturbine_defaults', data=inputs) + # Call to the django view endpoint /chp_defaults which calls the http.jl endpoint + resp = self.api_client.get(f'/dev/chp_defaults', data=inputs) view_response = json.loads(resp.content) mismatch = [] @@ -70,7 +71,7 @@ def test_steamturbine_defaults(self): # Check the endpoint logic with the expected selection self.assertEqual(http_response["prime_mover"], "steam_turbine") - self.assertEqual(http_response["size_class"], 2) + self.assertEqual(http_response["size_class"], 1) self.assertGreater(http_response["chp_size_based_on_avg_heating_load_kw"], 574.419) def test_absorption_chiller_defaults(self): diff --git a/job/urls.py b/job/urls.py index edc5dd63f..46bdc2851 100644 --- a/job/urls.py +++ b/job/urls.py @@ -37,7 +37,6 @@ re_path(r'^job/inputs/?$', views.inputs), re_path(r'^job/outputs/?$', views.outputs), re_path(r'^chp_defaults/?$', views.chp_defaults), - re_path(r'^steamturbine_defaults/?$', views.steamturbine_defaults), re_path(r'^absorption_chiller_defaults/?$', views.absorption_chiller_defaults), re_path(r'^emissions_profile/?$', views.emissions_profile), re_path(r'^easiur_costs/?$', views.easiur_costs), diff --git a/job/views.py b/job/views.py index 1ee683d73..ebca0630e 100644 --- a/job/views.py +++ b/job/views.py @@ -387,32 +387,6 @@ def peak_load_outage_times(request): tb.format_tb(exc_traceback)) log.debug(debug_msg) return JsonResponse({"Error": "Unexpected error in outage_times_based_on_load_peaks endpoint. Check log for more."}, status=500) - -def steamturbine_defaults(request): - inputs = { - "avg_boiler_fuel_load_mmbtu_per_hour": request.GET.get("avg_boiler_fuel_load_mmbtu_per_hour"), - "size_class": request.GET.get("size_class") - } - try: - julia_host = os.environ.get('JULIA_HOST', "julia") - http_jl_response = requests.get("http://" + julia_host + ":8081/steamturbine_defaults/", json=inputs) - response = JsonResponse( - http_jl_response.json() - ) - return response - - except ValueError as e: - return JsonResponse({"Error": str(e.args[0])}, status=500) - - except KeyError as e: - return JsonResponse({"Error. Missing": str(e.args[0])}, status=500) - - except Exception: - exc_type, exc_value, exc_traceback = sys.exc_info() - debug_msg = "exc_type: {}; exc_value: {}; exc_traceback: {}".format(exc_type, exc_value.args[0], - tb.format_tb(exc_traceback)) - log.debug(debug_msg) - return JsonResponse({"Error": "Unexpected error in steamturbine_defaults endpoint. Check log for more."}, status=500) def chp_defaults(request): inputs = { diff --git a/julia_src/http.jl b/julia_src/http.jl index 54190e119..36b9cc845 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -214,16 +214,22 @@ function chp_defaults(req::HTTP.Request) end end end - println(d) @info "Getting CHP defaults..." data = Dict() error_response = Dict() try d_symb = reoptjl.dictkeys_tosymbols(d) - data = reoptjl.get_chp_defaults_prime_mover_size_class(;d_symb...) + if haskey(d_symb, :prime_mover) && d_symb[:prime_mover] == "steam_turbine" + # delete!(d_symb, :prime_mover) + data = reoptjl.get_steam_turbine_defaults_size_class(; + avg_boiler_fuel_load_mmbtu_per_hour=get(d_symb, :avg_boiler_fuel_load_mmbtu_per_hour, nothing), + size_class=get(d_symb, :size_class, nothing)) + else + data = reoptjl.get_chp_defaults_prime_mover_size_class(;d_symb...) + end catch e - @error "Something went wrong in the chp_defaults" exception=(e, catch_backtrace()) + @error "Something went wrong in the chp_defaults endpoint" exception=(e, catch_backtrace()) error_response["error"] = sprint(showerror, e) end if isempty(error_response) @@ -278,47 +284,6 @@ function absorption_chiller_defaults(req::HTTP.Request) end end -# Should this accept all inputs provided in `get_steam_turbine_defaults_size_class` docstring in REopt.jl? -function steamturbine_defaults(req::HTTP.Request) - - d = JSON.parse(String(req.body)) - keys = ["avg_boiler_fuel_load_mmbtu_per_hour", - "size_class" - ] - # Process .json inputs and convert to correct type if needed - for k in keys - if !haskey(d, k) - d[k] = nothing - elseif !isnothing(d[k]) - if k == "avg_boiler_fuel_load_mmbtu_per_hour" && typeof(d[k]) == String - d[k] = parse(Float64, d[k]) - elseif k == "size_class" && typeof(d[k]) == String - d[k] = parse(Int64, d[k]) - end - end - end - - @info "Getting SteamTurbine defaults..." - data = Dict() - error_response = Dict() - try - data = reoptjl.get_steam_turbine_defaults_size_class(;avg_boiler_fuel_load_mmbtu_per_hour=d["avg_boiler_fuel_load_mmbtu_per_hour"], - size_class=d["size_class"] - ) - catch e - @error "Something went wrong in the steamturbine_defaults" exception=(e, catch_backtrace()) - error_response["error"] = sprint(showerror, e) - end - if isempty(error_response) - @info "SteamTurbine defaults determined." - response = data - return HTTP.Response(200, JSON.json(response)) - else - @info "An error occured in the steamturbine_defaults endpoint" - return HTTP.Response(500, JSON.json(error_response)) - end -end - function emissions_profile(req::HTTP.Request) d = JSON.parse(String(req.body)) @info "Getting emissions profile..." @@ -409,7 +374,6 @@ HTTP.@register(ROUTER, "POST", "/reopt", reopt) HTTP.@register(ROUTER, "POST", "/erp", erp) HTTP.@register(ROUTER, "POST", "/ghpghx", ghpghx) HTTP.@register(ROUTER, "GET", "/chp_defaults", chp_defaults) -HTTP.@register(ROUTER, "GET", "/steamturbine_defaults", steamturbine_defaults) HTTP.@register(ROUTER, "GET", "/emissions_profile", emissions_profile) HTTP.@register(ROUTER, "GET", "/easiur_costs", easiur_costs) HTTP.@register(ROUTER, "GET", "/simulated_load", simulated_load) From a714d977b8a3e7c52415357a8cd59a5ecdca9068 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 5 Jun 2023 22:02:42 -0600 Subject: [PATCH 45/92] WIP mod to test_job_endpoint for steamturbine test Added /dev/job call to get defaults from Julia, but REopt scenario is erroring --- job/test/test_job_endpoint.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/job/test/test_job_endpoint.py b/job/test/test_job_endpoint.py index ac5152021..af750bcb0 100644 --- a/job/test/test_job_endpoint.py +++ b/job/test/test_job_endpoint.py @@ -307,25 +307,35 @@ def test_superset_input_fields(self): assert(resp.status_code==200) def test_steamturbine_defaults_from_julia(self): - # Test that the inputs_with_defaults_set_in_julia feature worked for SteamTurbine, consistent with /steamturbine_defaults + # Test that the inputs_with_defaults_set_in_julia feature worked for SteamTurbine, consistent with /chp_defaults post_file = os.path.join('job', 'test', 'posts', 'steamturbine_defaults_post.json') post = json.load(open(post_file, 'r')) - + # Call http.jl /reopt to run SteamTurbine scenario and get results for defaults from julia checking + resp = self.api_client.post('/dev/job/', format='json', data=post) + self.assertHttpCreated(resp) + r = json.loads(resp.content) + run_uuid = r.get('run_uuid') + + resp = self.api_client.get(f'/dev/job/{run_uuid}/results') + r = json.loads(resp.content) + inputs_steamturbine = r["inputs"]["SteamTurbine"] avg_fuel_load = (post["SpaceHeatingLoad"]["annual_mmbtu"] + post["DomesticHotWaterLoad"]["annual_mmbtu"]) / 8760.0 + inputs_steamturbine_defaults = { + "prime_mover": "steam_turbine", "avg_boiler_fuel_load_mmbtu_per_hour": avg_fuel_load } - # Call to the django view endpoint /steamturbine_defaults which calls the http.jl endpoint - resp = self.api_client.get(f'/dev/steamturbine_defaults', data=inputs_steamturbine_defaults) + # Call to the django view endpoint /chp_defaults which calls the http.jl endpoint + resp = self.api_client.get(f'/dev/chp_defaults', data=inputs_steamturbine_defaults) view_response = json.loads(resp.content) for key in view_response["default_inputs"].keys(): - if post["SteamTurbine"].get(key) is None: # Check that default got assigned consistent with /steamturbine_defaults + if post["SteamTurbine"].get(key) is None: # Check that default got assigned consistent with /chp_defaults self.assertEquals(inputs_steamturbine[key], view_response["default_inputs"][key]) else: # Make sure we didn't overwrite user-input self.assertEquals(inputs_steamturbine[key], post["SteamTurbine"][key]) \ No newline at end of file From 50817d0835d0e14df4d0ebbeb0d0670135b95462 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 7 Aug 2023 16:37:05 -0600 Subject: [PATCH 46/92] Replace job with reoptjl in migrations --- ...ileroutputs_steamturbineinputs_and_more.py | 20 +++++++++---------- .../migrations/0037_merge_20230605_0505.py | 4 ++-- ...ngboilerinputs_can_supply_steam_turbine.py | 2 +- ..._fuel_escalation_rate_fraction_and_more.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/reoptjl/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py b/reoptjl/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py index 74bd396ce..133804369 100644 --- a/reoptjl/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py +++ b/reoptjl/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py @@ -4,20 +4,20 @@ import django.core.validators from django.db import migrations, models import django.db.models.deletion -import job.models +import reoptjl.models class Migration(migrations.Migration): dependencies = [ - ('job', '0034_alter_financialinputs_value_of_lost_load_per_kwh_and_more'), + ('reoptjl', '0034_alter_financialinputs_value_of_lost_load_per_kwh_and_more'), ] operations = [ migrations.CreateModel( name='BoilerInputs', fields=[ - ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerInputs', serialize=False, to='job.apimeta')), + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerInputs', serialize=False, to='reoptjl.apimeta')), ('min_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Minimum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), ('max_mmbtu_per_hour', models.FloatField(default=0.0, help_text='Maximum thermal power size', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100000000.0)])), ('efficiency', models.FloatField(default=0.8, help_text='New boiler system efficiency - conversion of fuel to usable heating thermal energy.', null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])), @@ -30,12 +30,12 @@ class Migration(migrations.Migration): ('fuel_type', models.TextField(blank=True, choices=[('natural_gas', 'Natural Gas'), ('landfill_bio_gas', 'Landfill Bio Gas'), ('propane', 'Propane'), ('diesel_oil', 'Diesel Oil'), ('uranium', 'Uranium')], default='natural_gas', help_text='Existing boiler fuel type, one of natural_gas, landfill_bio_gas, propane, diesel_oil, uranium', null=True)), ('can_supply_steam_turbine', models.BooleanField(blank=True, default=True, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True)), ], - bases=(job.models.BaseModel, models.Model), + bases=(reoptjl.models.BaseModel, models.Model), ), migrations.CreateModel( name='BoilerOutputs', fields=[ - ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerOutputs', serialize=False, to='job.apimeta')), + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='BoilerOutputs', serialize=False, to='reoptjl.apimeta')), ('fuel_consumption_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), ('thermal_to_load_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), ('year_one_fuel_cost_before_tax', models.FloatField(blank=True, null=True)), @@ -48,12 +48,12 @@ class Migration(migrations.Migration): ('lifecycle_fuel_cost_after_tax', models.FloatField(blank=True, null=True)), ('annual_thermal_production_mmbtu', models.FloatField(blank=True, null=True)), ], - bases=(job.models.BaseModel, models.Model), + bases=(reoptjl.models.BaseModel, models.Model), ), migrations.CreateModel( name='SteamTurbineInputs', fields=[ - ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SteamTurbineInputs', serialize=False, to='job.apimeta')), + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SteamTurbineInputs', serialize=False, to='reoptjl.apimeta')), ('min_kw', models.FloatField(blank=True, default=0.0, help_text='Minimum steam turbine size constraint for optimization', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), ('max_kw', models.FloatField(blank=True, default=0.0, help_text='Maximum steam turbine size constraint for optimization', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1000000000.0)])), ('size_class', models.IntegerField(blank=True, choices=[(0, 'Zero'), (1, 'One'), (2, 'Two'), (4, 'Four')], help_text='Steam turbine size class for using appropriate default inputs', null=True)), @@ -78,12 +78,12 @@ class Migration(migrations.Migration): ('macrs_option_years', models.IntegerField(blank=True, choices=[(0, 'Zero'), (5, 'Five'), (7, 'Seven')], default=0, help_text='Duration over which accelerated depreciation will occur. Set to zero to disable')), ('macrs_bonus_fraction', models.FloatField(blank=True, default=1.0, help_text='Percent of upfront project costs to depreciate in year one in addition to scheduled depreciation', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1)])), ], - bases=(job.models.BaseModel, models.Model), + bases=(reoptjl.models.BaseModel, models.Model), ), migrations.CreateModel( name='SteamTurbineOutputs', fields=[ - ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SteamTurbineOutputs', serialize=False, to='job.apimeta')), + ('meta', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='SteamTurbineOutputs', serialize=False, to='reoptjl.apimeta')), ('size_kw', models.FloatField(blank=True, null=True)), ('annual_thermal_consumption_mmbtu', models.FloatField(blank=True, null=True)), ('annual_electric_production_kwh', models.FloatField(blank=True, null=True)), @@ -96,7 +96,7 @@ class Migration(migrations.Migration): ('thermal_to_storage_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), ('thermal_to_load_series_mmbtu_per_hour', django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, null=True), default=list, size=None)), ], - bases=(job.models.BaseModel, models.Model), + bases=(reoptjl.models.BaseModel, models.Model), ), migrations.AlterField( model_name='electrictariffinputs', diff --git a/reoptjl/migrations/0037_merge_20230605_0505.py b/reoptjl/migrations/0037_merge_20230605_0505.py index d7276a026..33b612420 100644 --- a/reoptjl/migrations/0037_merge_20230605_0505.py +++ b/reoptjl/migrations/0037_merge_20230605_0505.py @@ -6,8 +6,8 @@ class Migration(migrations.Migration): dependencies = [ - ('job', '0035_boilerinputs_boileroutputs_steamturbineinputs_and_more'), - ('job', '0036_merge_20230424_1645'), + ('reoptjl', '0035_boilerinputs_boileroutputs_steamturbineinputs_and_more'), + ('reoptjl', '0036_merge_20230424_1645'), ] operations = [ diff --git a/reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py b/reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py index 2ed29ed78..86e84e8d5 100644 --- a/reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py +++ b/reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('job', '0037_merge_20230605_0505'), + ('reoptjl', '0037_merge_20230605_0505'), ] operations = [ diff --git a/reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py b/reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py index 9defacf94..4559fb5ae 100644 --- a/reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py +++ b/reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('job', '0038_existingboilerinputs_can_supply_steam_turbine'), + ('reoptjl', '0038_existingboilerinputs_can_supply_steam_turbine'), ] operations = [ From 456d0e515d8df6823ebcf130f3c4db95050e4d9f Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 7 Aug 2023 15:08:31 -0600 Subject: [PATCH 47/92] Remove rename_app for non-existing db --- bin/migrate | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/migrate b/bin/migrate index 7724db37f..79679e9b0 100755 --- a/bin/migrate +++ b/bin/migrate @@ -4,8 +4,6 @@ set -Eeuxo pipefail python checkdb.py -# python manage.py showmigrations --plan - -python manage.py rename_app job reoptjl +python manage.py showmigrations --plan python manage.py migrate From 73d9e099aa89180ea1db95680307f9936935383f Mon Sep 17 00:00:00 2001 From: bill-becker Date: Mon, 7 Aug 2023 15:08:31 -0600 Subject: [PATCH 48/92] Merge migrations --- reoptjl/migrations/0040_merge_20230807_2250.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 reoptjl/migrations/0040_merge_20230807_2250.py diff --git a/reoptjl/migrations/0040_merge_20230807_2250.py b/reoptjl/migrations/0040_merge_20230807_2250.py new file mode 100644 index 000000000..0ae6b3cf3 --- /dev/null +++ b/reoptjl/migrations/0040_merge_20230807_2250.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.7 on 2023-08-07 22:50 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('reoptjl', '0038_alter_generatorinputs_installed_cost_per_kw'), + ('reoptjl', '0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more'), + ] + + operations = [ + ] From 22f775a906861fa921af7e56297684fc70615080 Mon Sep 17 00:00:00 2001 From: zolanaj Date: Tue, 8 Aug 2023 12:04:21 -0600 Subject: [PATCH 49/92] convert cooling_pct_share to floating point numbers in http.jl simulated_load --- julia_src/http.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/julia_src/http.jl b/julia_src/http.jl index c61da22da..c6e3fce69 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -334,6 +334,10 @@ function simulated_load(req::HTTP.Request) d["percent_share"] = convert(Vector{Float64}, d["percent_share"]) end + if "cooling_pct_share" in keys(d) && typeof(d["cooling_pct_share"]) <: Vector{} + d["cooling_pct_share"] = convert(Vector{Float64}, d["cooling_pct_share"]) + end + @info "Getting CRB Loads..." data = Dict() error_response = Dict() From dce26767786134ab715e3056f0044efb3f1d14e5 Mon Sep 17 00:00:00 2001 From: Alex Zolan Date: Tue, 8 Aug 2023 12:10:39 -0600 Subject: [PATCH 50/92] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1ced799b..b1a44a940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ Classify the change according to the following categories: - Add `/ghp_efficiency_thermal_factors` endpoint to `job` app for v ##### Changed - Update a couple of GHP functions to use the GhpGhx.jl package instead of previous Julia scripts and data from v2 +##### Fixed +- Fixed a type mismatch bug in the `simulated_load` function within http.jl ## v2.14.0 ### Minor Updates From cc19988365c12c083a3551355b4ff581ce2688c5 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Tue, 8 Aug 2023 20:35:12 -0400 Subject: [PATCH 51/92] retest boiler and steamturbine, fix REopt to bug fix branch also add **_cost** to certain Financial to correspond with REopt.jl. --- julia_src/Manifest.toml | 152 +++++++++--------- ...oiler_fuel_cost_escalation_rate_fractio.py | 28 ++++ reoptjl/models.py | 6 +- reoptjl/test/posts/existingboiler_boiler.json | 27 ---- 4 files changed, 108 insertions(+), 105 deletions(-) create mode 100644 reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py delete mode 100644 reoptjl/test/posts/existingboiler_boiler.json diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 2213dacf6..f52fc1fac 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -5,16 +5,16 @@ manifest_format = "2.0" project_hash = "90e66426e70d2bf97b8a3e99508fcb404743b11d" [[deps.AbstractFFTs]] -deps = ["ChainRulesCore", "LinearAlgebra"] -git-tree-sha1 = "16b6dbc4cf7caee4e1e75c49485ec67b667098a0" +deps = ["ChainRulesCore", "LinearAlgebra", "Test"] +git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" -version = "1.3.1" +version = "1.5.0" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "cc37d689f599e8df4f464b2fa3870ff7db7492ef" +git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.6.1" +version = "3.6.2" [[deps.ArchGDAL]] deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"] @@ -57,10 +57,10 @@ uuid = "a74b3585-a348-5f62-a45c-50e91977d574" version = "0.7.3" [[deps.Blosc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "e94024822c0a5b14989abbdba57820ad5b177b95" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "6aa2d0b8db41ab860bbbf61b9587e3b957683fd3" uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" -version = "1.21.2+0" +version = "1.21.4+0" [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -74,10 +74,10 @@ uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" version = "0.4.2" [[deps.CSV]] -deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "SnoopPrecompile", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] -git-tree-sha1 = "c700cce799b51c9045473de751e9319bdd1c6e94" +deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] +git-tree-sha1 = "44dbf560808d49041989b8a96cae4cffbeb7966a" uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" -version = "0.10.9" +version = "0.10.11" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] @@ -122,9 +122,9 @@ uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" version = "0.12.10" [[deps.CommonSolve]] -git-tree-sha1 = "9441451ee712d1aec22edad62db1a9af3dc8d852" +git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" -version = "0.2.3" +version = "0.2.4" [[deps.CommonSubexpressions]] deps = ["MacroTools", "Test"] @@ -145,9 +145,9 @@ version = "1.0.1+0" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] -git-tree-sha1 = "89a9db8d28102b094992472d333674bd1a83ce2a" +git-tree-sha1 = "fe2838a593b5f776e1597e086dcd47560d94e816" uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.1" +version = "1.5.3" [[deps.CoolProp]] deps = ["CoolProp_jll", "Markdown", "Unitful"] @@ -167,15 +167,15 @@ uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" version = "4.1.1" [[deps.DataAPI]] -git-tree-sha1 = "e8119c1a33d267e16108be441a287a6981ba1630" +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.14.0" +version = "1.15.0" [[deps.DataFrames]] -deps = ["Compat", "DataAPI", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] -git-tree-sha1 = "aa51303df86f8626a962fccb878430cdb0a97eee" +deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "04c738083f29f86e62c8afc341f0967d8717bdb8" uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" -version = "1.5.0" +version = "1.6.1" [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] @@ -210,9 +210,9 @@ version = "1.13.0" [[deps.DiskArrays]] deps = ["OffsetArrays"] -git-tree-sha1 = "3f87990e0882e44c0f4e5c9699d09a0edbfa25c8" +git-tree-sha1 = "7e8dcba9d1d1ba8aa576f7d899d42e04d76431b2" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" -version = "0.3.9" +version = "0.3.15" [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] @@ -230,10 +230,10 @@ uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" [[deps.Expat_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "bad72f730e9e91c08d9427d5e8db95478a3c323d" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.4.8+0" +version = "2.5.0+0" [[deps.Extents]] git-tree-sha1 = "5e1e4c53fa39afe63a7d356e30452249365fba99" @@ -242,9 +242,9 @@ version = "0.1.1" [[deps.FileIO]] deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "7be5f99f7d15578798f338f5433b6c432ea8037b" +git-tree-sha1 = "299dc33549f68299137e51e6d49a13b5b1da9673" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.16.0" +version = "1.16.1" [[deps.FilePaths]] deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"] @@ -267,12 +267,6 @@ git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" version = "0.8.4" -[[deps.Formatting]] -deps = ["Printf"] -git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" -uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" -version = "0.4.2" - [[deps.ForwardDiff]] deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] git-tree-sha1 = "00e252f4d706b3d55a8863432e742bf5717b498d" @@ -285,9 +279,9 @@ uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" [[deps.GDAL]] deps = ["CEnum", "GDAL_jll", "NetworkOptions", "PROJ_jll"] -git-tree-sha1 = "aa6f8ca2f7a0eb46f4d8353eb725c717de40da6e" +git-tree-sha1 = "41ce0b68c058822c465e5f4a71d9249887e05a2f" uuid = "add2ef01-049f-52c4-9ee2-e494f65e021a" -version = "1.5.1" +version = "1.6.0" [[deps.GDAL_jll]] deps = ["Arrow_jll", "Artifacts", "Expat_jll", "GEOS_jll", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "LibPQ_jll", "Libdl", "Libtiff_jll", "NetCDF_jll", "OpenJpeg_jll", "PROJ_jll", "Pkg", "SQLite_jll", "Zlib_jll", "Zstd_jll", "libgeotiff_jll"] @@ -308,15 +302,15 @@ version = "0.4.1" [[deps.GeoInterface]] deps = ["Extents"] -git-tree-sha1 = "0eb6de0b312688f852f347171aba888658e29f20" +git-tree-sha1 = "bb198ff907228523f3dee1070ceee63b9359b6ab" uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" -version = "1.3.0" +version = "1.3.1" [[deps.GeoInterfaceRecipes]] deps = ["GeoInterface", "RecipesBase"] -git-tree-sha1 = "29e1ec25cfb6762f503a19495aec347acf867a9e" +git-tree-sha1 = "0e26e1737e94de57c858649dc28e482b6c87d341" uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" -version = "1.0.0" +version = "1.0.1" [[deps.GhpGhx]] git-tree-sha1 = "c74e436a02552a1d20bae5c6b84bb27cf33e8eb9" @@ -344,9 +338,9 @@ version = "0.1.1" [[deps.HDF5]] deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires", "UUIDs"] -git-tree-sha1 = "3dab31542b3da9f25a6a1d11159d4af8fdce7d67" +git-tree-sha1 = "c73fdc3d9da7700691848b78c61841274076932a" uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.16.14" +version = "0.16.15" [[deps.HDF5_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] @@ -556,9 +550,9 @@ uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" version = "0.5.10" [[deps.MappedArrays]] -git-tree-sha1 = "e8b359ef06ec72e8c030463fe02efe5527ee5142" +git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" -version = "0.4.1" +version = "0.4.2" [[deps.Markdown]] deps = ["Base64"] @@ -619,10 +613,10 @@ uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" version = "1.0.2" [[deps.NetCDF_jll]] -deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Pkg", "XML2_jll", "Zlib_jll"] -git-tree-sha1 = "072f8371f74c3b9e1b26679de7fbf059d45ea221" +deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "XML2_jll", "Zlib_jll"] +git-tree-sha1 = "7f5a03e6712f5447c9c344430b8d1927a4777483" uuid = "7243133f-43d8-5620-bbf4-c2c921802cf3" -version = "400.902.5+1" +version = "400.902.206+0" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" @@ -630,9 +624,9 @@ version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "82d7c9e310fe55aa54996e6f7f94674e2a38fcb4" +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.9" +version = "1.12.10" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] @@ -651,10 +645,10 @@ uuid = "05823500-19ac-5b8b-9628-191a04bc5112" version = "0.8.1+0" [[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9ff31d101d987eb9d66bd8b176ac7c277beccd09" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "bbb5c2115d63c2f1451cb70e5ef75e8fe4707019" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.20+0" +version = "1.1.22+0" [[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -675,9 +669,9 @@ version = "900.100.0+0" [[deps.PaddedViews]] deps = ["OffsetArrays"] -git-tree-sha1 = "03a7a85b76381a3d04c7a1656039197e70eda03d" +git-tree-sha1 = "0fac6313486baae819364c52b4f483450a9d793f" uuid = "5432bcbf-9aad-5242-b902-cca2824c8663" -version = "0.5.11" +version = "0.5.12" [[deps.Parsers]] deps = ["Dates", "SnoopPrecompile"] @@ -703,10 +697,16 @@ uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" version = "1.4.2" [[deps.PowerModelsDistribution]] -deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "fd2a5efc06acb1b449a985c48d4b3d8004a3b371" +deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SparseArrays", "SpecialFunctions", "Statistics"] +git-tree-sha1 = "60b4d3446f0ddce0f86ec779438c7fa3772ca216" uuid = "d7431456-977f-11e9-2de3-97ff7677985e" -version = "0.14.7" +version = "0.14.9" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.1.2" [[deps.Preferences]] deps = ["TOML"] @@ -715,10 +715,10 @@ uuid = "21216c6a-2e73-6563-6e65-726566657250" version = "1.3.0" [[deps.PrettyTables]] -deps = ["Crayons", "Formatting", "LaTeXStrings", "Markdown", "Reexport", "StringManipulation", "Tables"] -git-tree-sha1 = "548793c7859e28ef026dba514752275ee871169f" +deps = ["Crayons", "LaTeXStrings", "Markdown", "Printf", "Reexport", "StringManipulation", "Tables"] +git-tree-sha1 = "ee094908d720185ddbdc58dbe0c1cbe35453ec7a" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -version = "2.2.3" +version = "2.2.7" [[deps.Printf]] deps = ["Unicode"] @@ -734,9 +734,11 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "f37ab65ee394765c3735210dbfe84dc3847f380e" +git-tree-sha1 = "a96c4998b4be4dd50e6143078df61921a3a30494" +repo-rev = "steamturbine_bugfix" +repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.3" +version = "0.32.4" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -748,10 +750,10 @@ uuid = "b3c3ace0-ae52-54e7-9d0b-2c1406fd6b9d" version = "0.3.2" [[deps.RecipesBase]] -deps = ["SnoopPrecompile"] -git-tree-sha1 = "261dddd3b862bd2c940cf6ca4d1c8fe593e457c8" +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.3.3" +version = "1.3.4" [[deps.Reexport]] git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" @@ -766,9 +768,9 @@ version = "1.3.0" [[deps.Roots]] deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "b45deea4566988994ebb8fb80aa438a295995a6e" +git-tree-sha1 = "de432823e8aab4dd1a985be4be768f95acf152d4" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.10" +version = "2.0.17" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -782,9 +784,9 @@ version = "3.41.0+0" [[deps.SentinelArrays]] deps = ["Dates", "Random"] -git-tree-sha1 = "77d3c4726515dca71f6d80fbb5e251088defe305" +git-tree-sha1 = "04bdff0b09c65ff3e06a05e3eb7b120223da3d39" uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" -version = "1.3.18" +version = "1.4.0" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" @@ -806,9 +808,9 @@ uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.SortingAlgorithms]] deps = ["DataStructures"] -git-tree-sha1 = "a4ada03f999bd01b3a25dcaa30b2d929fe537e00" +git-tree-sha1 = "c60ec5c62180f27efea3ba2908480f8055e17cee" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.1.0" +version = "1.1.1" [[deps.SparseArrays]] deps = ["LinearAlgebra", "Random"] @@ -880,9 +882,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TestEnv]] deps = ["Pkg"] -git-tree-sha1 = "b5a483bcc8c9f0df569101df166601e5e699f346" +git-tree-sha1 = "c7c98d2bb491261207459c55ce041a68fd1b477b" uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b" -version = "1.9.3" +version = "1.100.0" [[deps.Thrift_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "boost_jll"] @@ -909,10 +911,10 @@ uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] -deps = ["ConstructionBase", "Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "bb37ed24f338bc59b83e3fc9f32dd388e5396c53" +deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] +git-tree-sha1 = "1cd9b6d3f637988ca788007b7466c132feebe263" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.12.4" +version = "1.16.1" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] diff --git a/reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py b/reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py new file mode 100644 index 000000000..183a9b9e6 --- /dev/null +++ b/reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py @@ -0,0 +1,28 @@ +# Generated by Django 4.0.7 on 2023-08-08 23:14 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('reoptjl', '0040_merge_20230807_2250'), + ] + + operations = [ + migrations.RenameField( + model_name='financialinputs', + old_name='boiler_fuel_escalation_rate_fraction', + new_name='boiler_fuel_cost_escalation_rate_fraction', + ), + migrations.RenameField( + model_name='financialinputs', + old_name='chp_fuel_escalation_rate_fraction', + new_name='chp_fuel_cost_escalation_rate_fraction', + ), + migrations.RenameField( + model_name='financialinputs', + old_name='existing_boiler_fuel_escalation_rate_fraction', + new_name='existing_boiler_fuel_cost_escalation_rate_fraction', + ), + ] diff --git a/reoptjl/models.py b/reoptjl/models.py index 57b8f7a18..3bdca68e9 100644 --- a/reoptjl/models.py +++ b/reoptjl/models.py @@ -827,7 +827,7 @@ class FinancialInputs(BaseModel, models.Model): blank=True, help_text=("Annual nominal boiler fuel cost escalation rate") ) - existing_boiler_fuel_escalation_rate_fraction = models.FloatField( + existing_boiler_fuel_cost_escalation_rate_fraction = models.FloatField( default=0.034, validators=[ MinValueValidator(-1), @@ -836,7 +836,7 @@ class FinancialInputs(BaseModel, models.Model): blank=True, help_text=("Annual nominal existing boiler fuel cost escalation rate") ) - boiler_fuel_escalation_rate_fraction = models.FloatField( + boiler_fuel_cost_escalation_rate_fraction = models.FloatField( default=0.034, validators=[ MinValueValidator(-1), @@ -845,7 +845,7 @@ class FinancialInputs(BaseModel, models.Model): blank=True, help_text=("Annual nominal boiler fuel cost escalation rate") ) - chp_fuel_escalation_rate_fraction = models.FloatField( + chp_fuel_cost_escalation_rate_fraction = models.FloatField( default=0.034, validators=[ MinValueValidator(-1), diff --git a/reoptjl/test/posts/existingboiler_boiler.json b/reoptjl/test/posts/existingboiler_boiler.json deleted file mode 100644 index 79c993f7b..000000000 --- a/reoptjl/test/posts/existingboiler_boiler.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Site": { - "latitude": 37.78, - "longitude": -122.45 - }, - "ExistingBoiler": { - "fuel_cost_per_mmbtu": 0.5 - }, - "Boiler": { - "fuel_cost_per_mmbtu": 0.25 - }, - "HotThermalStorage":{ - "max_gal":2500 - }, - "ElectricLoad": { - "doe_reference_name": "Hospital", - "annual_kwh": 8760000.0 - }, - "SpaceHeatingLoad": { - "doe_reference_name": "Hospital", - "annual_mmbtu": 29897.6 - }, - "ElectricTariff": { - "urdb_label": "5e1676e95457a3f87673e3b0" - }, - "APIMeta" : {} -} \ No newline at end of file From e5e744e1895d1d26e4a97148dbbd660d859a8052 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Wed, 9 Aug 2023 11:14:37 -0400 Subject: [PATCH 52/92] Align and clean up migrations --- .../migrations/0037_merge_20230605_0505.py | 14 -------- ...ngboilerinputs_can_supply_steam_turbine.py | 18 ---------- ..._fuel_escalation_rate_fraction_and_more.py | 34 ------------------- ...leroutputs_steamturbineinputs_and_more.py} | 29 ++++++++++++++-- .../migrations/0040_merge_20230807_2250.py | 14 -------- ...oiler_fuel_cost_escalation_rate_fractio.py | 28 --------------- 6 files changed, 27 insertions(+), 110 deletions(-) delete mode 100644 reoptjl/migrations/0037_merge_20230605_0505.py delete mode 100644 reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py delete mode 100644 reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py rename reoptjl/migrations/{0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py => 0040_boilerinputs_boileroutputs_steamturbineinputs_and_more.py} (88%) delete mode 100644 reoptjl/migrations/0040_merge_20230807_2250.py delete mode 100644 reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py diff --git a/reoptjl/migrations/0037_merge_20230605_0505.py b/reoptjl/migrations/0037_merge_20230605_0505.py deleted file mode 100644 index 33b612420..000000000 --- a/reoptjl/migrations/0037_merge_20230605_0505.py +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by Django 4.0.7 on 2023-06-05 05:05 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reoptjl', '0035_boilerinputs_boileroutputs_steamturbineinputs_and_more'), - ('reoptjl', '0036_merge_20230424_1645'), - ] - - operations = [ - ] diff --git a/reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py b/reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py deleted file mode 100644 index 86e84e8d5..000000000 --- a/reoptjl/migrations/0038_existingboilerinputs_can_supply_steam_turbine.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.0.7 on 2023-06-06 02:30 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reoptjl', '0037_merge_20230605_0505'), - ] - - operations = [ - migrations.AddField( - model_name='existingboilerinputs', - name='can_supply_steam_turbine', - field=models.BooleanField(blank=True, default=False, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True), - ), - ] diff --git a/reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py b/reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py deleted file mode 100644 index 4559fb5ae..000000000 --- a/reoptjl/migrations/0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 4.0.7 on 2023-06-06 03:13 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reoptjl', '0038_existingboilerinputs_can_supply_steam_turbine'), - ] - - operations = [ - migrations.AddField( - model_name='financialinputs', - name='boiler_fuel_escalation_rate_fraction', - field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), - ), - migrations.AddField( - model_name='financialinputs', - name='chp_fuel_escalation_rate_fraction', - field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal chp fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), - ), - migrations.AddField( - model_name='financialinputs', - name='existing_boiler_fuel_escalation_rate_fraction', - field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal existing boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), - ), - migrations.AddField( - model_name='financialinputs', - name='generator_fuel_cost_escalation_rate_fraction', - field=models.FloatField(blank=True, default=0.027, help_text='Annual nominal boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), - ), - ] diff --git a/reoptjl/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py b/reoptjl/migrations/0040_boilerinputs_boileroutputs_steamturbineinputs_and_more.py similarity index 88% rename from reoptjl/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py rename to reoptjl/migrations/0040_boilerinputs_boileroutputs_steamturbineinputs_and_more.py index 133804369..5af097c75 100644 --- a/reoptjl/migrations/0035_boilerinputs_boileroutputs_steamturbineinputs_and_more.py +++ b/reoptjl/migrations/0040_boilerinputs_boileroutputs_steamturbineinputs_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 4.0.7 on 2023-04-03 19:19 +# Generated by Django 4.0.7 on 2023-08-09 15:12 import django.contrib.postgres.fields import django.core.validators @@ -10,7 +10,7 @@ class Migration(migrations.Migration): dependencies = [ - ('reoptjl', '0034_alter_financialinputs_value_of_lost_load_per_kwh_and_more'), + ('reoptjl', '0039_merge_20230807_1639'), ] operations = [ @@ -98,6 +98,31 @@ class Migration(migrations.Migration): ], bases=(reoptjl.models.BaseModel, models.Model), ), + migrations.AddField( + model_name='existingboilerinputs', + name='can_supply_steam_turbine', + field=models.BooleanField(blank=True, default=False, help_text='If the boiler can supply steam to the steam turbine for electric production', null=True), + ), + migrations.AddField( + model_name='financialinputs', + name='boiler_fuel_cost_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), + migrations.AddField( + model_name='financialinputs', + name='chp_fuel_cost_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal chp fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), + migrations.AddField( + model_name='financialinputs', + name='existing_boiler_fuel_cost_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.034, help_text='Annual nominal existing boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), + migrations.AddField( + model_name='financialinputs', + name='generator_fuel_cost_escalation_rate_fraction', + field=models.FloatField(blank=True, default=0.027, help_text='Annual nominal boiler fuel cost escalation rate', validators=[django.core.validators.MinValueValidator(-1), django.core.validators.MaxValueValidator(1)]), + ), migrations.AlterField( model_name='electrictariffinputs', name='export_rate_beyond_net_metering_limit', diff --git a/reoptjl/migrations/0040_merge_20230807_2250.py b/reoptjl/migrations/0040_merge_20230807_2250.py deleted file mode 100644 index 0ae6b3cf3..000000000 --- a/reoptjl/migrations/0040_merge_20230807_2250.py +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by Django 4.0.7 on 2023-08-07 22:50 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reoptjl', '0038_alter_generatorinputs_installed_cost_per_kw'), - ('reoptjl', '0039_financialinputs_boiler_fuel_escalation_rate_fraction_and_more'), - ] - - operations = [ - ] diff --git a/reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py b/reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py deleted file mode 100644 index 183a9b9e6..000000000 --- a/reoptjl/migrations/0041_rename_boiler_fuel_escalation_rate_fraction_financialinputs_boiler_fuel_cost_escalation_rate_fractio.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 4.0.7 on 2023-08-08 23:14 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reoptjl', '0040_merge_20230807_2250'), - ] - - operations = [ - migrations.RenameField( - model_name='financialinputs', - old_name='boiler_fuel_escalation_rate_fraction', - new_name='boiler_fuel_cost_escalation_rate_fraction', - ), - migrations.RenameField( - model_name='financialinputs', - old_name='chp_fuel_escalation_rate_fraction', - new_name='chp_fuel_cost_escalation_rate_fraction', - ), - migrations.RenameField( - model_name='financialinputs', - old_name='existing_boiler_fuel_escalation_rate_fraction', - new_name='existing_boiler_fuel_cost_escalation_rate_fraction', - ), - ] From 032e91d47d78d7d6a1bde876594f9fa1e6afad77 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Wed, 9 Aug 2023 12:22:54 -0400 Subject: [PATCH 53/92] Update http.jl Fix bug which may fix Github action tests --- julia_src/http.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 469cc11b1..54265a4cc 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -127,7 +127,7 @@ function reopt(req::HTTP.Request) "Financial" => Dict(key=>getfield(model_inputs.s.financial, key) for key in inputs_with_defaults_from_easiur), "ElectricUtility" => Dict(key=>getfield(model_inputs.s.electric_utility, key) for key in inputs_with_defaults_from_avert), "CHP" => chp_dict, - "SteamTurbine" => steamturbine_dict + "SteamTurbine" => steamturbine_dict, "GHP" => ghp_dict ) catch e From 705cc3e6a1e5b21b34c9b6c3d6748885e2624171 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 9 Aug 2023 21:51:06 -0600 Subject: [PATCH 54/92] Update ExistingChiller cop inputs from Julia This takes the logic from Julia for the default COP if not input --- julia_src/http.jl | 11 ++++++++++- reoptjl/src/process_results.py | 9 ++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index c6e3fce69..e53e694fc 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -112,11 +112,20 @@ function reopt(req::HTTP.Request) else ghp_dict = Dict() end + if haskey(d, "CoolingLoad") + inputs_with_defaults_from_chiller = [ + :cop + ] + chiller_dict = Dict(key=>getfield(model_inputs.s.existing_chiller, key) for key in inputs_with_defaults_from_chiller) + else + chiller_dict = Dict() + end inputs_with_defaults_set_in_julia = Dict( "Financial" => Dict(key=>getfield(model_inputs.s.financial, key) for key in inputs_with_defaults_from_easiur), "ElectricUtility" => Dict(key=>getfield(model_inputs.s.electric_utility, key) for key in inputs_with_defaults_from_avert), "CHP" => chp_dict, - "GHP" => ghp_dict + "GHP" => ghp_dict, + "ExistingChiller" => chiller_dict ) catch e @error "Something went wrong in REopt optimization!" exception=(e, catch_backtrace()) diff --git a/reoptjl/src/process_results.py b/reoptjl/src/process_results.py index 709b1aae5..d598e7d87 100644 --- a/reoptjl/src/process_results.py +++ b/reoptjl/src/process_results.py @@ -33,7 +33,8 @@ ElectricUtilityInputs, ExistingBoilerOutputs, CHPOutputs, CHPInputs, \ ExistingChillerOutputs, CoolingLoadOutputs, HeatingLoadOutputs,\ HotThermalStorageOutputs, ColdThermalStorageOutputs, OutageOutputs,\ - REoptjlMessageOutputs, AbsorptionChillerOutputs, GHPInputs, GHPOutputs + REoptjlMessageOutputs, AbsorptionChillerOutputs, GHPInputs, GHPOutputs,\ + ExistingChillerInputs import numpy as np import sys import traceback as tb @@ -139,6 +140,12 @@ def update_inputs_in_database(inputs_to_update: dict, run_uuid: str) -> None: CHPInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["CHP"]) if inputs_to_update["GHP"]: GHPInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["GHP"]) + if inputs_to_update["ExistingChiller"]: + if not ExistingChillerInputs.objects.filter(meta__run_uuid=run_uuid): + meta = APIMeta.objects.get(run_uuid=run_uuid) + ExistingChillerInputs.create(meta=meta, **inputs_to_update["ExistingChiller"]).save() + else: + ExistingChillerInputs.objects.filter(meta__run_uuid=run_uuid).update(**inputs_to_update["ExistingChiller"]) except Exception as e: exc_type, exc_value, exc_traceback = sys.exc_info() debug_msg = "exc_type: {}; exc_value: {}; exc_traceback: {}".format( From b34c89560ba8a0897613eb382b33b4ecb430b0aa Mon Sep 17 00:00:00 2001 From: zolanaj Date: Thu, 10 Aug 2023 10:08:27 -0600 Subject: [PATCH 55/92] add endpoint get_existing_chiller_default_cop --- julia_src/http.jl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/julia_src/http.jl b/julia_src/http.jl index e53e694fc..d4c050f77 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -430,6 +430,27 @@ function health(req::HTTP.Request) return HTTP.Response(200, JSON.json(Dict("Julia-api"=>"healthy!"))) end +function get_existing_chiller_default_cop(req:HTTP.Request) + d = JSON.parse(String(req.body)) + + @info "Getting default existing chiller COP..." + try + chiller_cop = reoptjl.(d["existing_chiller_max_thermal_factor_on_peak_load"], + d["max_load_kw"], + d["max_load_kw_thermal"]) + catch e + @error "Something went wrong in the get_existing_chiller_default_cop" exception=(e, catch_backtrace()) + error_response["error"] = sprint(showerror, e) + end + if isempty(error_response) + @info("Default existing chiller COP detected.") + response = Dict([("chiller_cop", chiller_cop)]) + else + @info "An error occured in the ground_conductivity endpoint" + return HTTP.Response(500, JSON.json(error_response)) + end +end + # define REST endpoints to dispatch to "service" functions const ROUTER = HTTP.Router() @@ -445,4 +466,5 @@ HTTP.@register(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller HTTP.@register(ROUTER, "GET", "/ghp_efficiency_thermal_factors", ghp_efficiency_thermal_factors) HTTP.@register(ROUTER, "GET", "/ground_conductivity", ground_conductivity) HTTP.@register(ROUTER, "GET", "/health", health) +HTTP.@register(ROUTER, "GET", "/get_existing_chiller_default_cop", get_existing_chiller_default_cop) HTTP.serve(ROUTER, "0.0.0.0", 8081, reuseaddr=true) From 32d758e323bbe20cb9410bf0be5c2c1fa60221c5 Mon Sep 17 00:00:00 2001 From: zolanaj Date: Thu, 10 Aug 2023 10:30:28 -0600 Subject: [PATCH 56/92] add get_existing_chiller_default_cop to views.py --- reoptjl/views.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/reoptjl/views.py b/reoptjl/views.py index e328fdc44..ceca68cce 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -577,6 +577,43 @@ def ghp_efficiency_thermal_factors(request): log.debug(debug_msg) return JsonResponse({"Error": "Unexpected error in ghp_efficiency_thermal_factors endpoint. Check log for more."}, status=500) +def get_existing_chiller_default_cop(request): + """ + GET default existing chiller COP using the max thermal cooling load. + param: existing_chiller_max_thermal_factor_on_peak_load: max thermal factor on peak cooling load, i.e., "oversizing" of existing chiller [fraction] + param: max_load_kw: maximum electrical load [kW] + param: max_load_kw_thermal: maximum thermal cooling load [kW] + return: existing_chiller_cop: default COP of existing chiller [fraction] + """ + try: + existing_chiller_max_thermal_factor_on_peak_load = float(request.GET['existing_chiller_max_thermal_factor_on_peak_load']) # need float to convert unicode + max_load_kw = float(request.GET['max_load_kw']) + max_load_kw_thermal = float(request.GET['max_load_kw_thermal']) + + inputs_dict = {"existing_chiller_max_thermal_factor_on_peak_load": existing_chiller_max_thermal_factor_on_peak_load, + "max_load_kw": max_load_kw, + "max_load_kw_thermal": max_load_kw_thermal} + + julia_host = os.environ.get('JULIA_HOST', "julia") + http_jl_response = requests.get("http://" + julia_host + ":8081/get_existing_chiller_default_cop/", json=inputs_dict) + response = JsonResponse( + http_jl_response.json() + ) + return response + + except ValueError as e: + return JsonResponse({"Error": str(e.args[0])}, status=500) + + except KeyError as e: + return JsonResponse({"Error. Missing": str(e.args[0])}, status=500) + + except Exception: + exc_type, exc_value, exc_traceback = sys.exc_info() + debug_msg = "exc_type: {}; exc_value: {}; exc_traceback: {}".format(exc_type, exc_value.args[0], + tb.format_tb(exc_traceback)) + log.debug(debug_msg) + return JsonResponse({"Error": "Unexpected error in get_existing_chiller_default_cop endpoint. Check log for more."}, status=500) + def summary(request, user_uuid): """ From 9776f69a6edcf39f645e7c85dd26f6332e435645 Mon Sep 17 00:00:00 2001 From: zolanaj Date: Thu, 10 Aug 2023 11:39:54 -0600 Subject: [PATCH 57/92] update return key for get_existing_chiller_default_cop --- julia_src/http.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index d4c050f77..0eec6cc9d 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -430,7 +430,7 @@ function health(req::HTTP.Request) return HTTP.Response(200, JSON.json(Dict("Julia-api"=>"healthy!"))) end -function get_existing_chiller_default_cop(req:HTTP.Request) +function get_existing_chiller_default_cop(req::HTTP.Request) d = JSON.parse(String(req.body)) @info "Getting default existing chiller COP..." @@ -444,7 +444,7 @@ function get_existing_chiller_default_cop(req:HTTP.Request) end if isempty(error_response) @info("Default existing chiller COP detected.") - response = Dict([("chiller_cop", chiller_cop)]) + response = Dict([("existing_chiller_cop", chiller_cop)]) else @info "An error occured in the ground_conductivity endpoint" return HTTP.Response(500, JSON.json(error_response)) From 4afd042c9ddd21848807aa6829e9d7e4942bde23 Mon Sep 17 00:00:00 2001 From: zolanaj Date: Thu, 10 Aug 2023 12:47:03 -0600 Subject: [PATCH 58/92] add get_existing_chiller_default_cop to urls --- reoptjl/urls.py | 1 + 1 file changed, 1 insertion(+) diff --git a/reoptjl/urls.py b/reoptjl/urls.py index 8a34fb99f..5175a3455 100644 --- a/reoptjl/urls.py +++ b/reoptjl/urls.py @@ -48,4 +48,5 @@ re_path(r'^peak_load_outage_times/?$', views.peak_load_outage_times), re_path(r'^invalid_urdb/?$', reoviews.invalid_urdb), re_path(r'^schedule_stats/?$', reoviews.schedule_stats), + re_path(r'^get_existing_chiller_default_cop/?$', views.get_existing_chiller_default_cop), ] From 31a2be5e2f4bee191cef9af26d45d96433f53486 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 10 Aug 2023 15:30:26 -0600 Subject: [PATCH 59/92] Temporary change to REopt.jl develop branch --- julia_src/Manifest.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 2213dacf6..1e5277ebc 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -734,9 +734,11 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "f37ab65ee394765c3735210dbfe84dc3847f380e" +git-tree-sha1 = "bbee305dd2086d23ad96a58deeda58e34758cd41" +repo-rev = "develop" +repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.3" +version = "0.32.4" [[deps.Random]] deps = ["SHA", "Serialization"] From 0f80e778a1a9d9140480f179cfdb8b64726a3790 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 10 Aug 2023 15:31:34 -0600 Subject: [PATCH 60/92] Fix handling of monthly values in /simulated_load --- reoptjl/views.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index e328fdc44..8f235b4dd 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -506,14 +506,18 @@ def simulated_load(request): for key in valid_keys: for key_type in other_keys_types: if key_type in key: - value = request.GET.get(key) - if value is not None: - if type(value) == list: - monthly_list = [request.GET.get(key+'[{}]'.format(i)) for i in range(12)] - k = key.split('[')[0] - inputs[k] = [float(i) for i in monthly_list] - else: - inputs[key] = float(value) + print("Trying key_type", key_type, " conversion for key = ", key) + if (key_type in ["monthly", "addressable"]) and request.GET.get(key + "[0]") is not None: + try: + print("Trying monthly conversion for key = ", key) + monthly_list = [float(request.GET.get(key+'[{}]'.format(i))) for i in range(12)] + inputs[key] = monthly_list + except: + return JsonResponse({"Error. Monthly data does not contain 12 valid entries"}) + elif request.GET.get(key) is not None: + inputs[key] = float(request.GET.get(key)) + + print("inputs = ", inputs) julia_host = os.environ.get('JULIA_HOST', "julia") http_jl_response = requests.get("http://" + julia_host + ":8081/simulated_load/", json=inputs) From 65bd7f78c38c00b2b0875803c75e56d4a618a659 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Thu, 10 Aug 2023 15:31:51 -0600 Subject: [PATCH 61/92] Make type conversions for all monthly values --- julia_src/http.jl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index e53e694fc..dedec133f 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -339,13 +339,14 @@ function simulated_load(req::HTTP.Request) end end - if "percent_share" in keys(d) && typeof(d["percent_share"]) <: Vector{} - d["percent_share"] = convert(Vector{Float64}, d["percent_share"]) - end - - if "cooling_pct_share" in keys(d) && typeof(d["cooling_pct_share"]) <: Vector{} - d["cooling_pct_share"] = convert(Vector{Float64}, d["cooling_pct_share"]) - end + # Convert vectors which come in as Vector{Any} to Vector{Float} (within Vector{<:Real}) + vector_types = ["percent_share", "cooling_pct_share", "monthly_kwh", "monthly_mmbtu", + "monthly_tonhour", "addressable_load_fraction"] + for key in vector_types + if key in keys(d) && typeof(d[key]) <: Vector{} + d[key] = convert(Vector{Float64}, d[key]) + end + end @info "Getting CRB Loads..." data = Dict() From c2e0a9093ddb078e83abe3f573915050e026b059 Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:35:24 -0600 Subject: [PATCH 62/92] Remove debugging prints for simulated_load view --- reoptjl/views.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/reoptjl/views.py b/reoptjl/views.py index 8f235b4dd..ce14162c3 100644 --- a/reoptjl/views.py +++ b/reoptjl/views.py @@ -506,18 +506,14 @@ def simulated_load(request): for key in valid_keys: for key_type in other_keys_types: if key_type in key: - print("Trying key_type", key_type, " conversion for key = ", key) if (key_type in ["monthly", "addressable"]) and request.GET.get(key + "[0]") is not None: try: - print("Trying monthly conversion for key = ", key) monthly_list = [float(request.GET.get(key+'[{}]'.format(i))) for i in range(12)] inputs[key] = monthly_list except: return JsonResponse({"Error. Monthly data does not contain 12 valid entries"}) elif request.GET.get(key) is not None: inputs[key] = float(request.GET.get(key)) - - print("inputs = ", inputs) julia_host = os.environ.get('JULIA_HOST', "julia") http_jl_response = requests.get("http://" + julia_host + ":8081/simulated_load/", json=inputs) From d6d4b6b750f45bcfaca8e2f8fa28cfdea0e0d607 Mon Sep 17 00:00:00 2001 From: zolanaj Date: Thu, 10 Aug 2023 22:52:51 -0600 Subject: [PATCH 63/92] add get_existing_chiller_default_cop http endpoint test --- reoptjl/test/test_http_endpoints.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/reoptjl/test/test_http_endpoints.py b/reoptjl/test/test_http_endpoints.py index 1677783e6..71f19a394 100644 --- a/reoptjl/test/test_http_endpoints.py +++ b/reoptjl/test/test_http_endpoints.py @@ -181,4 +181,18 @@ def test_ghp_endpoints(self): resp = self.api_client.get(f'/dev/ghpghx/ground_conductivity', data=inputs_dict) view_response = json.loads(resp.content) - self.assertEqual(view_response["thermal_conductivity"], 1.117) \ No newline at end of file + self.assertEqual(view_response["thermal_conductivity"], 1.117) + + def test_default_existing_chiller_cop(self): + inputs_dict = { + "existing_chiller_max_thermal_factor_on_peak_load":1.25, + "max_load_kw": 50, + "max_load_kw_thermal":100 + } + + # Call to the django view endpoint /ghp_efficiency_thermal_factors which calls the http.jl endpoint + resp = self.api_client.get(f'/dev/get_existing_chiller_default_cop', data=inputs_dict) + view_response = json.loads(resp.content) + print(view_response) + + self.assertEqual(view_response["existing_chiller_cop"], 4.4) \ No newline at end of file From 5b19bbe6a1bf890fc5d3510843f39f3b192fc2c2 Mon Sep 17 00:00:00 2001 From: zolanaj Date: Thu, 10 Aug 2023 22:53:07 -0600 Subject: [PATCH 64/92] fix get_existing_chiller_default_cop call in http.jl --- julia_src/http.jl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 0eec6cc9d..8285ae9bc 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -432,12 +432,21 @@ end function get_existing_chiller_default_cop(req::HTTP.Request) d = JSON.parse(String(req.body)) + chiller_cop = nothing + + for key in ["existing_chiller_max_thermal_factor_on_peak_load","max_load_kw","max_load_kw_thermal"] + if !(key in keys(d)) + d[key] = nothing + end + end @info "Getting default existing chiller COP..." + error_response = Dict() try - chiller_cop = reoptjl.(d["existing_chiller_max_thermal_factor_on_peak_load"], - d["max_load_kw"], - d["max_load_kw_thermal"]) + chiller_cop = reoptjl.get_existing_chiller_default_cop(; + existing_chiller_max_thermal_factor_on_peak_load=d["existing_chiller_max_thermal_factor_on_peak_load"], + max_load_kw=d["max_load_kw"], + max_load_kw_thermal=d["max_load_kw_thermal"]) catch e @error "Something went wrong in the get_existing_chiller_default_cop" exception=(e, catch_backtrace()) error_response["error"] = sprint(showerror, e) @@ -445,8 +454,9 @@ function get_existing_chiller_default_cop(req::HTTP.Request) if isempty(error_response) @info("Default existing chiller COP detected.") response = Dict([("existing_chiller_cop", chiller_cop)]) + return HTTP.Response(200, JSON.json(response)) else - @info "An error occured in the ground_conductivity endpoint" + @info "An error occured in the get_existing_chiller_default_cop endpoint" return HTTP.Response(500, JSON.json(error_response)) end end From df818f92b24413bea408b26c002ed0798043dec5 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Fri, 11 Aug 2023 15:40:20 -0400 Subject: [PATCH 65/92] Update Manifest.toml free REopt --- julia_src/Manifest.toml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index f52fc1fac..249ae8880 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -156,10 +156,10 @@ uuid = "e084ae63-2819-5025-826e-f8e611a84251" version = "0.1.0" [[deps.CoolProp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6b492e9aafcd6016d5aca105567ed2271c423015" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "3e707957390c96dbe6184dc27eb6da2f5d2e6aac" uuid = "3351c21f-4feb-5f29-afb9-f4fcb0e27549" -version = "6.4.3+0" +version = "6.5.0+0" [[deps.Crayons]] git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" @@ -734,11 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "a96c4998b4be4dd50e6143078df61921a3a30494" -repo-rev = "steamturbine_bugfix" -repo-url = "https://github.com/NREL/REopt.jl.git" +git-tree-sha1 = "17e39d318a6a158072d9b0f323e6b0a92d276e9c" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.4" +version = "0.32.5" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -882,9 +880,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TestEnv]] deps = ["Pkg"] -git-tree-sha1 = "c7c98d2bb491261207459c55ce041a68fd1b477b" +git-tree-sha1 = "dca851f0824deaf6a73ef1308fe7b2c53239c710" uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b" -version = "1.100.0" +version = "1.100.1" [[deps.Thrift_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "boost_jll"] @@ -912,9 +910,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] -git-tree-sha1 = "1cd9b6d3f637988ca788007b7466c132feebe263" +git-tree-sha1 = "64eb17acef1d9734cf09967539818f38093d9b35" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.16.1" +version = "1.16.2" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] From 68652606d93650fb05c1010cb60535a2314a2c85 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 11 Aug 2023 15:41:29 -0600 Subject: [PATCH 66/92] Update REopt.jl to v0.32.5 --- julia_src/Manifest.toml | 250 ++++++++++++++++++++-------------------- 1 file changed, 122 insertions(+), 128 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 2213dacf6..29a9dba46 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -5,16 +5,16 @@ manifest_format = "2.0" project_hash = "90e66426e70d2bf97b8a3e99508fcb404743b11d" [[deps.AbstractFFTs]] -deps = ["ChainRulesCore", "LinearAlgebra"] -git-tree-sha1 = "16b6dbc4cf7caee4e1e75c49485ec67b667098a0" +deps = ["ChainRulesCore", "LinearAlgebra", "Test"] +git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" -version = "1.3.1" +version = "1.5.0" [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "cc37d689f599e8df4f464b2fa3870ff7db7492ef" +git-tree-sha1 = "76289dc51920fdc6e0013c872ba9551d54961c24" uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.6.1" +version = "3.6.2" [[deps.ArchGDAL]] deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"] @@ -57,10 +57,10 @@ uuid = "a74b3585-a348-5f62-a45c-50e91977d574" version = "0.7.3" [[deps.Blosc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "e94024822c0a5b14989abbdba57820ad5b177b95" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "6aa2d0b8db41ab860bbbf61b9587e3b957683fd3" uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" -version = "1.21.2+0" +version = "1.21.4+0" [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -74,22 +74,22 @@ uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" version = "0.4.2" [[deps.CSV]] -deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "SnoopPrecompile", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] -git-tree-sha1 = "c700cce799b51c9045473de751e9319bdd1c6e94" +deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"] +git-tree-sha1 = "44dbf560808d49041989b8a96cae4cffbeb7966a" uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" -version = "0.10.9" +version = "0.10.11" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "c6d890a52d2c4d55d326439580c3b8d0875a77d9" +git-tree-sha1 = "e30f2f4e20f7f186dc36529910beaedc60cfa644" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.15.7" +version = "1.16.0" [[deps.ChangesOfVariables]] -deps = ["ChainRulesCore", "LinearAlgebra", "Test"] -git-tree-sha1 = "485193efd2176b88e6622a39a246f8c5b600e74e" +deps = ["InverseFunctions", "LinearAlgebra", "Test"] +git-tree-sha1 = "2fba81a302a7be671aefe194f0525ef231104e7f" uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" -version = "0.1.6" +version = "0.1.8" [[deps.CodecBzip2]] deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] @@ -99,9 +99,9 @@ version = "0.7.2" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "9c209fb7536406834aa938fb149964b985de6c83" +git-tree-sha1 = "02aa26a4cf76381be7f66e020a3eddeb27b0a092" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.1" +version = "0.7.2" [[deps.ColorTypes]] deps = ["FixedPointNumbers", "Random"] @@ -122,9 +122,9 @@ uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" version = "0.12.10" [[deps.CommonSolve]] -git-tree-sha1 = "9441451ee712d1aec22edad62db1a9af3dc8d852" +git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" -version = "0.2.3" +version = "0.2.4" [[deps.CommonSubexpressions]] deps = ["MacroTools", "Test"] @@ -134,9 +134,9 @@ version = "0.3.0" [[deps.Compat]] deps = ["Dates", "LinearAlgebra", "UUIDs"] -git-tree-sha1 = "7a60c856b9fa189eb34f5f8a6f6b5529b7942957" +git-tree-sha1 = "e460f044ca8b99be31d35fe54fc33a5c33dd8ed7" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.6.1" +version = "4.9.0" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] @@ -145,9 +145,9 @@ version = "1.0.1+0" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] -git-tree-sha1 = "89a9db8d28102b094992472d333674bd1a83ce2a" +git-tree-sha1 = "fe2838a593b5f776e1597e086dcd47560d94e816" uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.1" +version = "1.5.3" [[deps.CoolProp]] deps = ["CoolProp_jll", "Markdown", "Unitful"] @@ -156,10 +156,10 @@ uuid = "e084ae63-2819-5025-826e-f8e611a84251" version = "0.1.0" [[deps.CoolProp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6b492e9aafcd6016d5aca105567ed2271c423015" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "3e707957390c96dbe6184dc27eb6da2f5d2e6aac" uuid = "3351c21f-4feb-5f29-afb9-f4fcb0e27549" -version = "6.4.3+0" +version = "6.5.0+0" [[deps.Crayons]] git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" @@ -167,21 +167,21 @@ uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" version = "4.1.1" [[deps.DataAPI]] -git-tree-sha1 = "e8119c1a33d267e16108be441a287a6981ba1630" +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.14.0" +version = "1.15.0" [[deps.DataFrames]] -deps = ["Compat", "DataAPI", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] -git-tree-sha1 = "aa51303df86f8626a962fccb878430cdb0a97eee" +deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "04c738083f29f86e62c8afc341f0967d8717bdb8" uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" -version = "1.5.0" +version = "1.6.1" [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0" +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.13" +version = "0.18.15" [[deps.DataValueInterfaces]] git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" @@ -204,15 +204,15 @@ version = "1.1.0" [[deps.DiffRules]] deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "a4ad7ef19d2cdc2eff57abbbe68032b1cd0bd8f8" +git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.13.0" +version = "1.15.1" [[deps.DiskArrays]] deps = ["OffsetArrays"] -git-tree-sha1 = "3f87990e0882e44c0f4e5c9699d09a0edbfa25c8" +git-tree-sha1 = "7e8dcba9d1d1ba8aa576f7d899d42e04d76431b2" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" -version = "0.3.9" +version = "0.3.15" [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] @@ -230,10 +230,10 @@ uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" [[deps.Expat_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "bad72f730e9e91c08d9427d5e8db95478a3c323d" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.4.8+0" +version = "2.5.0+0" [[deps.Extents]] git-tree-sha1 = "5e1e4c53fa39afe63a7d356e30452249365fba99" @@ -242,9 +242,9 @@ version = "0.1.1" [[deps.FileIO]] deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "7be5f99f7d15578798f338f5433b6c432ea8037b" +git-tree-sha1 = "299dc33549f68299137e51e6d49a13b5b1da9673" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.16.0" +version = "1.16.1" [[deps.FilePaths]] deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"] @@ -267,17 +267,11 @@ git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" version = "0.8.4" -[[deps.Formatting]] -deps = ["Printf"] -git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" -uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" -version = "0.4.2" - [[deps.ForwardDiff]] deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "00e252f4d706b3d55a8863432e742bf5717b498d" +git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.35" +version = "0.10.36" [[deps.Future]] deps = ["Random"] @@ -285,9 +279,9 @@ uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" [[deps.GDAL]] deps = ["CEnum", "GDAL_jll", "NetworkOptions", "PROJ_jll"] -git-tree-sha1 = "aa6f8ca2f7a0eb46f4d8353eb725c717de40da6e" +git-tree-sha1 = "41ce0b68c058822c465e5f4a71d9249887e05a2f" uuid = "add2ef01-049f-52c4-9ee2-e494f65e021a" -version = "1.5.1" +version = "1.6.0" [[deps.GDAL_jll]] deps = ["Arrow_jll", "Artifacts", "Expat_jll", "GEOS_jll", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "LibPQ_jll", "Libdl", "Libtiff_jll", "NetCDF_jll", "OpenJpeg_jll", "PROJ_jll", "Pkg", "SQLite_jll", "Zlib_jll", "Zstd_jll", "libgeotiff_jll"] @@ -308,15 +302,15 @@ version = "0.4.1" [[deps.GeoInterface]] deps = ["Extents"] -git-tree-sha1 = "0eb6de0b312688f852f347171aba888658e29f20" +git-tree-sha1 = "bb198ff907228523f3dee1070ceee63b9359b6ab" uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" -version = "1.3.0" +version = "1.3.1" [[deps.GeoInterfaceRecipes]] deps = ["GeoInterface", "RecipesBase"] -git-tree-sha1 = "29e1ec25cfb6762f503a19495aec347acf867a9e" +git-tree-sha1 = "0e26e1737e94de57c858649dc28e482b6c87d341" uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" -version = "1.0.0" +version = "1.0.1" [[deps.GhpGhx]] git-tree-sha1 = "c74e436a02552a1d20bae5c6b84bb27cf33e8eb9" @@ -344,9 +338,9 @@ version = "0.1.1" [[deps.HDF5]] deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires", "UUIDs"] -git-tree-sha1 = "3dab31542b3da9f25a6a1d11159d4af8fdce7d67" +git-tree-sha1 = "c73fdc3d9da7700691848b78c61841274076932a" uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.16.14" +version = "0.16.15" [[deps.HDF5_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] @@ -389,15 +383,15 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.IntervalSets]] deps = ["Dates", "Random", "Statistics"] -git-tree-sha1 = "16c0cc91853084cb5f58a78bd209513900206ce6" +git-tree-sha1 = "8e59ea773deee525c99a8018409f64f19fb719e6" uuid = "8197267c-284f-5f27-9208-e0e47529a953" -version = "0.7.4" +version = "0.7.7" [[deps.InverseFunctions]] deps = ["Test"] -git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f" +git-tree-sha1 = "68772f49f54b479fa88ace904f6127f0a3bb2e46" uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.8" +version = "0.1.12" [[deps.InvertedIndices]] git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038" @@ -410,9 +404,9 @@ uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" version = "0.2.2" [[deps.IterTools]] -git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5" +git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.4.0" +version = "1.8.0" [[deps.IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" @@ -530,9 +524,9 @@ version = "2.12.0+0" [[deps.LogExpFunctions]] deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "0a1b7c2863e44523180fdb3146534e265a91870b" +git-tree-sha1 = "c3ce8e7420b3a6e071e0fe4745f5d4300e37b13f" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.23" +version = "0.3.24" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -556,9 +550,9 @@ uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" version = "0.5.10" [[deps.MappedArrays]] -git-tree-sha1 = "e8b359ef06ec72e8c030463fe02efe5527ee5142" +git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" -version = "0.4.1" +version = "0.4.2" [[deps.Markdown]] deps = ["Base64"] @@ -619,10 +613,10 @@ uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" version = "1.0.2" [[deps.NetCDF_jll]] -deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Pkg", "XML2_jll", "Zlib_jll"] -git-tree-sha1 = "072f8371f74c3b9e1b26679de7fbf059d45ea221" +deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "XML2_jll", "Zlib_jll"] +git-tree-sha1 = "7f5a03e6712f5447c9c344430b8d1927a4777483" uuid = "7243133f-43d8-5620-bbf4-c2c921802cf3" -version = "400.902.5+1" +version = "400.902.206+0" [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" @@ -630,9 +624,9 @@ version = "1.2.0" [[deps.OffsetArrays]] deps = ["Adapt"] -git-tree-sha1 = "82d7c9e310fe55aa54996e6f7f94674e2a38fcb4" +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.9" +version = "1.12.10" [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] @@ -651,10 +645,10 @@ uuid = "05823500-19ac-5b8b-9628-191a04bc5112" version = "0.8.1+0" [[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9ff31d101d987eb9d66bd8b176ac7c277beccd09" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "bbb5c2115d63c2f1451cb70e5ef75e8fe4707019" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "1.1.20+0" +version = "1.1.22+0" [[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -663,9 +657,9 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.5+0" [[deps.OrderedCollections]] -git-tree-sha1 = "d78db6df34313deaca15c5c0b9ff562c704fe1ab" +git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.5.0" +version = "1.6.2" [[deps.PROJ_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Libtiff_jll", "Pkg", "SQLite_jll"] @@ -675,15 +669,15 @@ version = "900.100.0+0" [[deps.PaddedViews]] deps = ["OffsetArrays"] -git-tree-sha1 = "03a7a85b76381a3d04c7a1656039197e70eda03d" +git-tree-sha1 = "0fac6313486baae819364c52b4f483450a9d793f" uuid = "5432bcbf-9aad-5242-b902-cca2824c8663" -version = "0.5.11" +version = "0.5.12" [[deps.Parsers]] -deps = ["Dates", "SnoopPrecompile"] -git-tree-sha1 = "478ac6c952fddd4399e71d4779797c538d0ff2bf" +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.5.8" +version = "2.7.2" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] @@ -703,22 +697,28 @@ uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" version = "1.4.2" [[deps.PowerModelsDistribution]] -deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "fd2a5efc06acb1b449a985c48d4b3d8004a3b371" +deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SparseArrays", "SpecialFunctions", "Statistics"] +git-tree-sha1 = "60b4d3446f0ddce0f86ec779438c7fa3772ca216" uuid = "d7431456-977f-11e9-2de3-97ff7677985e" -version = "0.14.7" +version = "0.14.9" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.1.2" [[deps.Preferences]] deps = ["TOML"] -git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d" +git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1" uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.3.0" +version = "1.4.0" [[deps.PrettyTables]] -deps = ["Crayons", "Formatting", "LaTeXStrings", "Markdown", "Reexport", "StringManipulation", "Tables"] -git-tree-sha1 = "548793c7859e28ef026dba514752275ee871169f" +deps = ["Crayons", "LaTeXStrings", "Markdown", "Printf", "Reexport", "StringManipulation", "Tables"] +git-tree-sha1 = "ee094908d720185ddbdc58dbe0c1cbe35453ec7a" uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -version = "2.2.3" +version = "2.2.7" [[deps.Printf]] deps = ["Unicode"] @@ -734,9 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "f37ab65ee394765c3735210dbfe84dc3847f380e" +git-tree-sha1 = "17e39d318a6a158072d9b0f323e6b0a92d276e9c" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.3" +version = "0.32.5" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -748,10 +748,10 @@ uuid = "b3c3ace0-ae52-54e7-9d0b-2c1406fd6b9d" version = "0.3.2" [[deps.RecipesBase]] -deps = ["SnoopPrecompile"] -git-tree-sha1 = "261dddd3b862bd2c940cf6ca4d1c8fe593e457c8" +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.3.3" +version = "1.3.4" [[deps.Reexport]] git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" @@ -766,9 +766,9 @@ version = "1.3.0" [[deps.Roots]] deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "b45deea4566988994ebb8fb80aa438a295995a6e" +git-tree-sha1 = "de432823e8aab4dd1a985be4be768f95acf152d4" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.10" +version = "2.0.17" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -776,15 +776,15 @@ version = "0.7.0" [[deps.SQLite_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "54d66b0f69f4578f4988fc08d579783fcdcd764f" +git-tree-sha1 = "4619dd3363610d94fb42a95a6dc35b526a26d0ef" uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" -version = "3.41.0+0" +version = "3.42.0+0" [[deps.SentinelArrays]] deps = ["Dates", "Random"] -git-tree-sha1 = "77d3c4726515dca71f6d80fbb5e251088defe305" +git-tree-sha1 = "04bdff0b09c65ff3e06a05e3eb7b120223da3d39" uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" -version = "1.3.18" +version = "1.4.0" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" @@ -795,20 +795,14 @@ git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" version = "1.1.1" -[[deps.SnoopPrecompile]] -deps = ["Preferences"] -git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" -uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" -version = "1.0.3" - [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" [[deps.SortingAlgorithms]] deps = ["DataStructures"] -git-tree-sha1 = "a4ada03f999bd01b3a25dcaa30b2d929fe537e00" +git-tree-sha1 = "c60ec5c62180f27efea3ba2908480f8055e17cee" uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.1.0" +version = "1.1.1" [[deps.SparseArrays]] deps = ["LinearAlgebra", "Random"] @@ -816,9 +810,9 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[deps.SpecialFunctions]] deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "ef28127915f4229c971eb43f3fc075dd3fe91880" +git-tree-sha1 = "7beb031cf8145577fbccacd94b8a8f4ce78428d3" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.2.0" +version = "2.3.0" [[deps.StackViews]] deps = ["OffsetArrays"] @@ -828,14 +822,14 @@ version = "0.1.1" [[deps.StaticArrays]] deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "b8d897fe7fa688e93aef573711cb207c08c9e11e" +git-tree-sha1 = "9cabadf6e7cd2349b6cf49f1915ad2028d65e881" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.19" +version = "1.6.2" [[deps.StaticArraysCore]] -git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.0" +version = "1.4.2" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] @@ -880,9 +874,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.TestEnv]] deps = ["Pkg"] -git-tree-sha1 = "b5a483bcc8c9f0df569101df166601e5e699f346" +git-tree-sha1 = "dca851f0824deaf6a73ef1308fe7b2c53239c710" uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b" -version = "1.9.3" +version = "1.100.1" [[deps.Thrift_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "boost_jll"] @@ -892,14 +886,14 @@ version = "0.16.0+0" [[deps.TranscodingStreams]] deps = ["Random", "Test"] -git-tree-sha1 = "94f38103c984f89cf77c402f2a68dbd870f8165f" +git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.11" +version = "0.9.13" [[deps.URIs]] -git-tree-sha1 = "074f993b0ca030848b897beff716d93aca60f06a" +git-tree-sha1 = "b7a5e99f24892b6824a954199a45e9ffcc1c70f0" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.4.2" +version = "1.5.0" [[deps.UUIDs]] deps = ["Random", "SHA"] @@ -909,10 +903,10 @@ uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] -deps = ["ConstructionBase", "Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "bb37ed24f338bc59b83e3fc9f32dd388e5396c53" +deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] +git-tree-sha1 = "64eb17acef1d9734cf09967539818f38093d9b35" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.12.4" +version = "1.16.2" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] @@ -944,9 +938,9 @@ version = "1.2.12+3" [[deps.Zstd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "c6edfe154ad7b313c01aceca188c05c835c67360" +git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c" uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.4+0" +version = "1.5.5+0" [[deps.boost_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] From ae6dd93035a40d240faf588b667c572afa04d505 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Sat, 12 Aug 2023 23:17:44 -0400 Subject: [PATCH 67/92] Update test_erp.py Add 1% optimality tolerance to ERP POST and adjust one test assertion. --- resilience_stats/tests/test_erp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resilience_stats/tests/test_erp.py b/resilience_stats/tests/test_erp.py index 9a0a84dca..64d5270ce 100644 --- a/resilience_stats/tests/test_erp.py +++ b/resilience_stats/tests/test_erp.py @@ -127,6 +127,7 @@ def test_erp_with_reopt_run_uuid(self): """ data = json.load(open(self.post_opt, 'rb')) + data["Settings"]["optimality_tolerance"] = 1.0e-2 # REopt_tol per line 38. resp = self.get_response_opt(data) self.assertHttpCreated(resp) r_opt = json.loads(resp.content) @@ -174,7 +175,7 @@ def test_erp_with_reopt_run_uuid(self): resp = self.get_results_sim(erp_run_uuid) results = json.loads(resp.content) - self.assertAlmostEqual(results["outputs"]["mean_cumulative_survival_by_duration"][23], 0.965763, places=4) + self.assertAlmostEqual(results["outputs"]["mean_cumulative_survival_by_duration"][23], 0.966098, places=4) self.assertAlmostEqual(results["outputs"]["cumulative_survival_final_time_step"][0], 0.962327, places=4) self.assertAlmostEqual(results["outputs"]["mean_cumulative_survival_final_time_step"], 0.965763, places=3) From 72de05657810eb8ee0d15d23c898d4d37dd95a0e Mon Sep 17 00:00:00 2001 From: bill-becker Date: Tue, 15 Aug 2023 14:49:37 -0600 Subject: [PATCH 68/92] Merge migrations --- reoptjl/migrations/0040_merge_20230815_2047.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 reoptjl/migrations/0040_merge_20230815_2047.py diff --git a/reoptjl/migrations/0040_merge_20230815_2047.py b/reoptjl/migrations/0040_merge_20230815_2047.py new file mode 100644 index 000000000..df464cd90 --- /dev/null +++ b/reoptjl/migrations/0040_merge_20230815_2047.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.7 on 2023-08-15 20:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('reoptjl', '0037_merge_20230505_1941'), + ('reoptjl', '0039_merge_20230807_1639'), + ] + + operations = [ + ] From b2171a396b9fc6f61eb203d6c285a9ca9363b8db Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Sat, 12 Aug 2023 23:17:44 -0400 Subject: [PATCH 69/92] Update test_erp.py Add 1% optimality tolerance to ERP POST and adjust one test assertion. --- resilience_stats/tests/test_erp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resilience_stats/tests/test_erp.py b/resilience_stats/tests/test_erp.py index 9a0a84dca..64d5270ce 100644 --- a/resilience_stats/tests/test_erp.py +++ b/resilience_stats/tests/test_erp.py @@ -127,6 +127,7 @@ def test_erp_with_reopt_run_uuid(self): """ data = json.load(open(self.post_opt, 'rb')) + data["Settings"]["optimality_tolerance"] = 1.0e-2 # REopt_tol per line 38. resp = self.get_response_opt(data) self.assertHttpCreated(resp) r_opt = json.loads(resp.content) @@ -174,7 +175,7 @@ def test_erp_with_reopt_run_uuid(self): resp = self.get_results_sim(erp_run_uuid) results = json.loads(resp.content) - self.assertAlmostEqual(results["outputs"]["mean_cumulative_survival_by_duration"][23], 0.965763, places=4) + self.assertAlmostEqual(results["outputs"]["mean_cumulative_survival_by_duration"][23], 0.966098, places=4) self.assertAlmostEqual(results["outputs"]["cumulative_survival_final_time_step"][0], 0.962327, places=4) self.assertAlmostEqual(results["outputs"]["mean_cumulative_survival_final_time_step"], 0.965763, places=3) From 484ea2a0801c95adda5240d1efb505d82ce01097 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 18 Aug 2023 08:36:36 -0600 Subject: [PATCH 70/92] Update expected test value because of PVWatts upgrade --- reoptjl/test/test_job_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 999e39638..6c6e66d33 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -60,7 +60,7 @@ def test_multiple_outages(self): self.assertAlmostEqual(results["Outages"]["expected_outage_cost"], 0.0, places=-2) self.assertAlmostEqual(sum(sum(np.array(results["Outages"]["unserved_load_per_outage_kwh"]))), 0.0, places=0) self.assertAlmostEqual(results["Outages"]["microgrid_upgrade_capital_cost"], 1927766, places=-2) - self.assertAlmostEqual(results["Financial"]["lcc"], 59597421, places=-3) + self.assertAlmostEqual(results["Financial"]["lcc"], 59658835, places=-3) def test_pv_battery_and_emissions_defaults_from_julia(self): """ From e2208c79a3ba0ef3a62d1befc89494acd1742d38 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 18 Aug 2023 10:35:16 -0600 Subject: [PATCH 71/92] Update test_pv_battery... after PVWatts update These updated expected values are consistent with the updates made in the equivalent REopt.jl test --- reoptjl/test/test_job_endpoint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 6c6e66d33..320fc6ec9 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -64,7 +64,7 @@ def test_multiple_outages(self): def test_pv_battery_and_emissions_defaults_from_julia(self): """ - Same test post as"Solar and Storage w/BAU" in the Julia package. Used in development of v3. + Same test post as"Solar and ElectricStorage w/BAU" in the Julia package. Used in development of v3. Also tests that inputs with defaults determined in the REopt julia package get updated in the database. """ post_file = os.path.join('reoptjl', 'test', 'posts', 'pv_batt_emissions.json') @@ -79,11 +79,11 @@ def test_pv_battery_and_emissions_defaults_from_julia(self): r = json.loads(resp.content) results = r["outputs"] - self.assertAlmostEqual(results["Financial"]["lcc"], 1.240037e7, places=-3) + self.assertAlmostEqual(results["Financial"]["lcc"], 12391786, places=-3) self.assertAlmostEqual(results["Financial"]["lcc_bau"], 12766397, places=-3) self.assertAlmostEqual(results["PV"]["size_kw"], 216.667, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 55.9, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 78.9, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 49.05, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 83.32, places=1) self.assertIsNotNone(results["Site"]["total_renewable_energy_fraction"]) self.assertIsNotNone(results["Site"]["annual_emissions_tonnes_CO2"]) From 6325039ce424844ac81666e191fe5638cf2247a7 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 18 Aug 2023 10:35:16 -0600 Subject: [PATCH 72/92] Update test_pv_battery... after PVWatts update These updated expected values are consistent with the updates made in the equivalent REopt.jl test --- reoptjl/test/test_job_endpoint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 6c6e66d33..320fc6ec9 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -64,7 +64,7 @@ def test_multiple_outages(self): def test_pv_battery_and_emissions_defaults_from_julia(self): """ - Same test post as"Solar and Storage w/BAU" in the Julia package. Used in development of v3. + Same test post as"Solar and ElectricStorage w/BAU" in the Julia package. Used in development of v3. Also tests that inputs with defaults determined in the REopt julia package get updated in the database. """ post_file = os.path.join('reoptjl', 'test', 'posts', 'pv_batt_emissions.json') @@ -79,11 +79,11 @@ def test_pv_battery_and_emissions_defaults_from_julia(self): r = json.loads(resp.content) results = r["outputs"] - self.assertAlmostEqual(results["Financial"]["lcc"], 1.240037e7, places=-3) + self.assertAlmostEqual(results["Financial"]["lcc"], 12391786, places=-3) self.assertAlmostEqual(results["Financial"]["lcc_bau"], 12766397, places=-3) self.assertAlmostEqual(results["PV"]["size_kw"], 216.667, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 55.9, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 78.9, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 49.05, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 83.32, places=1) self.assertIsNotNone(results["Site"]["total_renewable_energy_fraction"]) self.assertIsNotNone(results["Site"]["annual_emissions_tonnes_CO2"]) From b053d0ee3172aa8700a82348f8b503eecc7a77b8 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 18 Aug 2023 10:35:16 -0600 Subject: [PATCH 73/92] Update test_pv_battery... after PVWatts update These updated expected values are consistent with the updates made in the equivalent REopt.jl test --- reoptjl/test/test_job_endpoint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 6c6e66d33..320fc6ec9 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -64,7 +64,7 @@ def test_multiple_outages(self): def test_pv_battery_and_emissions_defaults_from_julia(self): """ - Same test post as"Solar and Storage w/BAU" in the Julia package. Used in development of v3. + Same test post as"Solar and ElectricStorage w/BAU" in the Julia package. Used in development of v3. Also tests that inputs with defaults determined in the REopt julia package get updated in the database. """ post_file = os.path.join('reoptjl', 'test', 'posts', 'pv_batt_emissions.json') @@ -79,11 +79,11 @@ def test_pv_battery_and_emissions_defaults_from_julia(self): r = json.loads(resp.content) results = r["outputs"] - self.assertAlmostEqual(results["Financial"]["lcc"], 1.240037e7, places=-3) + self.assertAlmostEqual(results["Financial"]["lcc"], 12391786, places=-3) self.assertAlmostEqual(results["Financial"]["lcc_bau"], 12766397, places=-3) self.assertAlmostEqual(results["PV"]["size_kw"], 216.667, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 55.9, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 78.9, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 49.05, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 83.32, places=1) self.assertIsNotNone(results["Site"]["total_renewable_energy_fraction"]) self.assertIsNotNone(results["Site"]["annual_emissions_tonnes_CO2"]) From 548a0f7ec63659bce2dcc6d44a6ea28f14fc91da Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 18 Aug 2023 08:36:36 -0600 Subject: [PATCH 74/92] Update expected test value because of PVWatts upgrade --- reoptjl/test/test_job_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 5721db400..272a97b9f 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -60,7 +60,7 @@ def test_multiple_outages(self): self.assertAlmostEqual(results["Outages"]["expected_outage_cost"], 0.0, places=-2) self.assertAlmostEqual(sum(sum(np.array(results["Outages"]["unserved_load_per_outage_kwh"]))), 0.0, places=0) self.assertAlmostEqual(results["Outages"]["microgrid_upgrade_capital_cost"], 1927766, places=-2) - self.assertAlmostEqual(results["Financial"]["lcc"], 59597421, places=-3) + self.assertAlmostEqual(results["Financial"]["lcc"], 59658835, places=-3) def test_pv_battery_and_emissions_defaults_from_julia(self): """ From ed59385414f0137ddd07deed9d32bcb05f5c4399 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 18 Aug 2023 10:35:16 -0600 Subject: [PATCH 75/92] Update test_pv_battery... after PVWatts update These updated expected values are consistent with the updates made in the equivalent REopt.jl test --- reoptjl/test/test_job_endpoint.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 272a97b9f..a82d63789 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -64,7 +64,7 @@ def test_multiple_outages(self): def test_pv_battery_and_emissions_defaults_from_julia(self): """ - Same test post as"Solar and Storage w/BAU" in the Julia package. Used in development of v3. + Same test post as"Solar and ElectricStorage w/BAU" in the Julia package. Used in development of v3. Also tests that inputs with defaults determined in the REopt julia package get updated in the database. """ post_file = os.path.join('reoptjl', 'test', 'posts', 'pv_batt_emissions.json') @@ -79,11 +79,11 @@ def test_pv_battery_and_emissions_defaults_from_julia(self): r = json.loads(resp.content) results = r["outputs"] - self.assertAlmostEqual(results["Financial"]["lcc"], 1.240037e7, places=-3) + self.assertAlmostEqual(results["Financial"]["lcc"], 12391786, places=-3) self.assertAlmostEqual(results["Financial"]["lcc_bau"], 12766397, places=-3) self.assertAlmostEqual(results["PV"]["size_kw"], 216.667, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 55.9, places=1) - self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 78.9, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kw"], 49.05, places=1) + self.assertAlmostEqual(results["ElectricStorage"]["size_kwh"], 83.32, places=1) self.assertIsNotNone(results["Site"]["total_renewable_energy_fraction"]) self.assertIsNotNone(results["Site"]["annual_emissions_tonnes_CO2"]) From eb78f5292891b31153cfbaade581220d0f60e217 Mon Sep 17 00:00:00 2001 From: Alex Zolan Date: Fri, 18 Aug 2023 12:14:24 -0600 Subject: [PATCH 76/92] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1a44a940..bad41328f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,8 @@ Classify the change according to the following categories: ### Minor Updates ##### Added - Add `GHP` to `job` app for v3 -- Add `/ghp_efficiency_thermal_factors` endpoint to `job` app for v +- Add `/ghp_efficiency_thermal_factors` endpoint to `job` app for v3 +- Add `/get_existing_chiller_default_cop` endpoint to `job` app for v3 ##### Changed - Update a couple of GHP functions to use the GhpGhx.jl package instead of previous Julia scripts and data from v2 ##### Fixed From c4c52f462998c3539fa4d6e1bdfc0762393607bc Mon Sep 17 00:00:00 2001 From: zolanaj Date: Fri, 18 Aug 2023 13:38:58 -0600 Subject: [PATCH 77/92] docstring edit --- reoptjl/test/test_job_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index 320fc6ec9..62c92941e 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -64,7 +64,7 @@ def test_multiple_outages(self): def test_pv_battery_and_emissions_defaults_from_julia(self): """ - Same test post as"Solar and ElectricStorage w/BAU" in the Julia package. Used in development of v3. + Same test post as "Solar and ElectricStorage w/BAU" in the Julia package. Used in development of v3. Also tests that inputs with defaults determined in the REopt julia package get updated in the database. """ post_file = os.path.join('reoptjl', 'test', 'posts', 'pv_batt_emissions.json') From 96d2477e6d2bbf239d7a66baed1cc3695026f60a Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 18 Aug 2023 13:57:51 -0600 Subject: [PATCH 78/92] Fix path from job -> reoptjl for steamturbine test --- reoptjl/test/test_job_endpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index a82d63789..f80dd6383 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -323,7 +323,7 @@ def test_superset_input_fields(self): def test_steamturbine_defaults_from_julia(self): # Test that the inputs_with_defaults_set_in_julia feature worked for SteamTurbine, consistent with /chp_defaults - post_file = os.path.join('job', 'test', 'posts', 'steamturbine_defaults_post.json') + post_file = os.path.join('reoptjl', 'test', 'posts', 'steamturbine_defaults_post.json') post = json.load(open(post_file, 'r')) # Call http.jl /reopt to run SteamTurbine scenario and get results for defaults from julia checking From a95e3667ded7f52bdfca6f3b6a33f9f589c5576c Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Fri, 18 Aug 2023 16:30:55 -0400 Subject: [PATCH 79/92] Update all inputs and steam turbine defaults tests Change max wind size to 0 since call to wind toolkit errors out using nojul configuration. --- reoptjl/test/posts/all_inputs_test.json | 25 ++++++++++++++++++++++++- reoptjl/test/test_job_endpoint.py | 13 ++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/reoptjl/test/posts/all_inputs_test.json b/reoptjl/test/posts/all_inputs_test.json index afa4e59d3..cd1bd71e3 100644 --- a/reoptjl/test/posts/all_inputs_test.json +++ b/reoptjl/test/posts/all_inputs_test.json @@ -216,7 +216,7 @@ "temperature_celsius": [], "pressure_atmospheres": [], "min_kw": 0.0, - "max_kw": 1000000000.0, + "max_kw": 0.0, "installed_cost_per_kw": 1600.0, "om_cost_per_kw": 16.0, "macrs_option_years": 5, @@ -283,5 +283,28 @@ "om_cost_per_mmbtu": 0.0, "fuel_type": "natural_gas", "can_supply_steam_turbine": true + }, + "SteamTurbine": { + "size_class": null, + "min_kw": 0.0, + "max_kw": 2000.0, + "electric_produced_to_thermal_consumed_ratio": 0.06943772380142663, + "thermal_produced_to_thermal_consumed_ratio": 0.9235301046193706, + "is_condensing": false, + "inlet_steam_pressure_psig": 600.0, + "outlet_steam_pressure_psig": 150.0, + "outlet_steam_min_vapor_fraction": 0.8, + "isentropic_efficiency": 0.612, + "gearbox_generator_efficiency": 0.94, + "net_to_gross_electric_ratio": 0.966, + "installed_cost_per_kw": 682.0, + "om_cost_per_kw": 0.0, + "om_cost_per_kwh": 0.009, + "can_net_meter": false, + "can_wholesale": false, + "can_export_beyond_nem_limit": false, + "can_curtail": false, + "macrs_option_years": 0, + "macrs_bonus_fraction": 1.0 } } \ No newline at end of file diff --git a/reoptjl/test/test_job_endpoint.py b/reoptjl/test/test_job_endpoint.py index f80dd6383..290ae08be 100644 --- a/reoptjl/test/test_job_endpoint.py +++ b/reoptjl/test/test_job_endpoint.py @@ -318,7 +318,7 @@ def test_superset_input_fields(self): r = json.loads(resp.content) results = r["outputs"] - self.assertAlmostEqual(results["Financial"]["npv"], -11682.27, places=0) + self.assertAlmostEqual(results["Financial"]["npv"], 11323.01, places=0) assert(resp.status_code==200) def test_steamturbine_defaults_from_julia(self): @@ -350,7 +350,10 @@ def test_steamturbine_defaults_from_julia(self): view_response = json.loads(resp.content) for key in view_response["default_inputs"].keys(): - if post["SteamTurbine"].get(key) is None: # Check that default got assigned consistent with /chp_defaults - self.assertEquals(inputs_steamturbine[key], view_response["default_inputs"][key]) - else: # Make sure we didn't overwrite user-input - self.assertEquals(inputs_steamturbine[key], post["SteamTurbine"][key]) \ No newline at end of file + # skip this key because its NaN in REoptInputs but is populated in /chp_defaults response. + if key != "inlet_steam_temperature_degF": + if post["SteamTurbine"].get(key) is None: # Check that default got assigned consistent with /chp_defaults + self.assertEquals(inputs_steamturbine[key], view_response["default_inputs"][key]) + else: # Make sure we didn't overwrite user-input + self.assertEquals(inputs_steamturbine[key], post["SteamTurbine"][key]) + \ No newline at end of file From 46e2ee7cb1191fbfae4c636f150b2bdc5664ce17 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sat, 19 Aug 2023 08:12:07 -0600 Subject: [PATCH 80/92] Update HTTP.jl in julia_src env --- julia_src/Manifest.toml | 70 +++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index ec112a554..f8d5fec09 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -148,6 +148,12 @@ deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "1.0.1+0" +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "5372dbbf8f0bdb8c700db5367132925c0771ef7e" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.2.1" + [[deps.ConstructionBase]] deps = ["LinearAlgebra"] git-tree-sha1 = "fe2838a593b5f776e1597e086dcd47560d94e816" @@ -219,10 +225,6 @@ git-tree-sha1 = "7e8dcba9d1d1ba8aa576f7d899d42e04d76431b2" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" version = "0.3.15" -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - [[deps.DocStringExtensions]] deps = ["LibGit2"] git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" @@ -234,6 +236,12 @@ deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" @@ -251,12 +259,6 @@ git-tree-sha1 = "299dc33549f68299137e51e6d49a13b5b1da9673" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" version = "1.16.1" -[[deps.FilePaths]] -deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"] -git-tree-sha1 = "919d9412dbf53a2e6fe74af62a73ceed0bce0629" -uuid = "8fc22ac5-c921-52a6-82fd-178b2807b824" -version = "0.8.3" - [[deps.FilePathsBase]] deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"] git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12" @@ -349,10 +351,10 @@ uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" version = "1.12.2+2" [[deps.HTTP]] -deps = ["Base64", "CodecZlib", "Dates", "IniFile", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "37e4657cd56b11abe3d10cd4a1ec5fbdb4180263" +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "cb56ccdd481c0dd7f975ad2b3b62d9eda088f7e2" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.7.4" +version = "1.9.14" [[deps.ImageCore]] deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] @@ -360,11 +362,6 @@ git-tree-sha1 = "acf614720ef026d38400b3817614c45882d75500" uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" version = "0.9.4" -[[deps.IniFile]] -git-tree-sha1 = "f550e6e32074c939295eb5ea6de31849ac2c9625" -uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" -version = "0.5.1" - [[deps.InlineStrings]] deps = ["Parsers"] git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" @@ -414,10 +411,10 @@ uuid = "4138dd39-2aa7-5051-a626-17a0bb65d9c8" version = "0.13.3" [[deps.JLLWrappers]] -deps = ["Preferences"] -git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1" +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.4.1" +version = "1.5.0" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -518,9 +515,9 @@ version = "2.12.0+0" [[deps.LogExpFunctions]] deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "c3ce8e7420b3a6e071e0fe4745f5d4300e37b13f" +git-tree-sha1 = "5ab83e1679320064c29e8973034357655743d22d" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.24" +version = "0.3.25" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -634,9 +631,9 @@ version = "0.8.1+0" [[deps.OpenSSL]] deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] -git-tree-sha1 = "5b3e170ea0724f1e3ed6018c5b006c190f80e87d" +git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" -version = "1.3.5" +version = "1.4.1" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -684,12 +681,6 @@ git-tree-sha1 = "a6062fe4063cdafe78f4a0a81cfffb89721b30e7" uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" version = "1.4.2" -[[deps.PowerModelsDistribution]] -deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SparseArrays", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "60b4d3446f0ddce0f86ec779438c7fa3772ca216" -uuid = "d7431456-977f-11e9-2de3-97ff7677985e" -version = "0.14.9" - [[deps.PrecompileTools]] deps = ["Preferences"] git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" @@ -754,9 +745,9 @@ version = "1.3.0" [[deps.Roots]] deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "de432823e8aab4dd1a985be4be768f95acf152d4" +git-tree-sha1 = "ff42754a57bb0d6dcfe302fd0d4272853190421f" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.17" +version = "2.0.19" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -783,6 +774,11 @@ git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" version = "1.1.1" +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -798,9 +794,9 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[deps.SpecialFunctions]] deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "7beb031cf8145577fbccacd94b8a8f4ce78428d3" +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.3.0" +version = "2.3.1" [[deps.StackViews]] deps = ["OffsetArrays"] @@ -892,9 +888,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] -git-tree-sha1 = "64eb17acef1d9734cf09967539818f38093d9b35" +git-tree-sha1 = "607c142139151faa591b5e80d8055a15e487095b" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.16.2" +version = "1.16.3" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] From eb3cdf10b05972d6cd741e55322202567e492b10 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Sat, 19 Aug 2023 20:58:34 -0400 Subject: [PATCH 81/92] Update Manifest.toml point to specific REopt.jl branch where the failing test should pass. --- julia_src/Manifest.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 249ae8880..46beb303c 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -734,9 +734,11 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "17e39d318a6a158072d9b0f323e6b0a92d276e9c" +git-tree-sha1 = "37fbff771f638c44bf0f4a4f32c9ea7acb2da3fd" +repo-rev = "boiler_stmturbine_debug" +repo-url = "https://github.com/NREL/REopt.jl.git" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.5" +version = "0.32.4" [[deps.Random]] deps = ["SHA", "Serialization"] From 6ffae41c8ce12dc98209af6720b4e371bbc1dc97 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 21 Aug 2023 14:46:10 -0400 Subject: [PATCH 82/92] Update Manifest.toml Update to latest REopt version. --- julia_src/Manifest.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 46beb303c..8188e0298 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -734,11 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "37fbff771f638c44bf0f4a4f32c9ea7acb2da3fd" -repo-rev = "boiler_stmturbine_debug" -repo-url = "https://github.com/NREL/REopt.jl.git" +git-tree-sha1 = "dc4c1dee6bff928e6c23b173e13392ddeae8c975" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.4" +version = "0.32.6" [[deps.Random]] deps = ["SHA", "Serialization"] From 758687965a880796fbf4a9f7db7d33105a795d19 Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Mon, 21 Aug 2023 19:45:38 -0400 Subject: [PATCH 83/92] Update CHANGELOG.md and replace mentions of `job` with `reoptjl` after app name change in v2.14.0 --- CHANGELOG.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bad41328f..89d069bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,11 +29,15 @@ Classify the change according to the following categories: ## Develop 2023-08-07 ### Minor Updates ##### Added -- Add `GHP` to `job` app for v3 -- Add `/ghp_efficiency_thermal_factors` endpoint to `job` app for v3 -- Add `/get_existing_chiller_default_cop` endpoint to `job` app for v3 +- Add `GHP` to `reoptjl` app for v3 +- Add `Boiler` to `reoptjl` app for v3 along with appropriate tests +- Add `SteamTurbine` to `reoptjl` app for v3 along with appropriate tests +- Add `/ghp_efficiency_thermal_factors` endpoint to `reoptjl` app for v3 +- Add `/get_existing_chiller_default_cop` endpoint to `reoptjl` app for v3 +- Add `/get_chp_defaults` endpoint to `reoptjl` app ##### Changed - Update a couple of GHP functions to use the GhpGhx.jl package instead of previous Julia scripts and data from v2 +- Update `julia_src/` TOML files to point to **REopt.jlv0.32.6** ##### Fixed - Fixed a type mismatch bug in the `simulated_load` function within http.jl From cff91faf3b5d9c92914a0f88d4bac50dff23f92f Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Tue, 22 Aug 2023 15:35:16 -0400 Subject: [PATCH 84/92] Update Manifest.toml Replace with #develop Manifest.TOML --- julia_src/Manifest.toml | 100 +++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 53 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 8188e0298..8e34a3e29 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -81,15 +81,15 @@ version = "0.10.11" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "c6d890a52d2c4d55d326439580c3b8d0875a77d9" +git-tree-sha1 = "e30f2f4e20f7f186dc36529910beaedc60cfa644" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.15.7" +version = "1.16.0" [[deps.ChangesOfVariables]] -deps = ["ChainRulesCore", "LinearAlgebra", "Test"] -git-tree-sha1 = "485193efd2176b88e6622a39a246f8c5b600e74e" +deps = ["InverseFunctions", "LinearAlgebra", "Test"] +git-tree-sha1 = "2fba81a302a7be671aefe194f0525ef231104e7f" uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" -version = "0.1.6" +version = "0.1.8" [[deps.CodecBzip2]] deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] @@ -99,9 +99,9 @@ version = "0.7.2" [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "9c209fb7536406834aa938fb149964b985de6c83" +git-tree-sha1 = "02aa26a4cf76381be7f66e020a3eddeb27b0a092" uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.1" +version = "0.7.2" [[deps.ColorTypes]] deps = ["FixedPointNumbers", "Random"] @@ -134,9 +134,9 @@ version = "0.3.0" [[deps.Compat]] deps = ["Dates", "LinearAlgebra", "UUIDs"] -git-tree-sha1 = "7a60c856b9fa189eb34f5f8a6f6b5529b7942957" +git-tree-sha1 = "e460f044ca8b99be31d35fe54fc33a5c33dd8ed7" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.6.1" +version = "4.9.0" [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] @@ -179,9 +179,9 @@ version = "1.6.1" [[deps.DataStructures]] deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0" +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.13" +version = "0.18.15" [[deps.DataValueInterfaces]] git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" @@ -204,9 +204,9 @@ version = "1.1.0" [[deps.DiffRules]] deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "a4ad7ef19d2cdc2eff57abbbe68032b1cd0bd8f8" +git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.13.0" +version = "1.15.1" [[deps.DiskArrays]] deps = ["OffsetArrays"] @@ -269,9 +269,9 @@ version = "0.8.4" [[deps.ForwardDiff]] deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "00e252f4d706b3d55a8863432e742bf5717b498d" +git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.35" +version = "0.10.36" [[deps.Future]] deps = ["Random"] @@ -383,15 +383,15 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.IntervalSets]] deps = ["Dates", "Random", "Statistics"] -git-tree-sha1 = "16c0cc91853084cb5f58a78bd209513900206ce6" +git-tree-sha1 = "8e59ea773deee525c99a8018409f64f19fb719e6" uuid = "8197267c-284f-5f27-9208-e0e47529a953" -version = "0.7.4" +version = "0.7.7" [[deps.InverseFunctions]] deps = ["Test"] -git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f" +git-tree-sha1 = "68772f49f54b479fa88ace904f6127f0a3bb2e46" uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.8" +version = "0.1.12" [[deps.InvertedIndices]] git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038" @@ -404,9 +404,9 @@ uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" version = "0.2.2" [[deps.IterTools]] -git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5" +git-tree-sha1 = "4ced6667f9974fc5c5943fa5e2ef1ca43ea9e450" uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" -version = "1.4.0" +version = "1.8.0" [[deps.IteratorInterfaceExtensions]] git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" @@ -524,9 +524,9 @@ version = "2.12.0+0" [[deps.LogExpFunctions]] deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "0a1b7c2863e44523180fdb3146534e265a91870b" +git-tree-sha1 = "c3ce8e7420b3a6e071e0fe4745f5d4300e37b13f" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.23" +version = "0.3.24" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -657,9 +657,9 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" version = "0.5.5+0" [[deps.OrderedCollections]] -git-tree-sha1 = "d78db6df34313deaca15c5c0b9ff562c704fe1ab" +git-tree-sha1 = "2e73fe17cac3c62ad1aebe70d44c963c3cfdc3e3" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.5.0" +version = "1.6.2" [[deps.PROJ_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "Libtiff_jll", "Pkg", "SQLite_jll"] @@ -674,10 +674,10 @@ uuid = "5432bcbf-9aad-5242-b902-cca2824c8663" version = "0.5.12" [[deps.Parsers]] -deps = ["Dates", "SnoopPrecompile"] -git-tree-sha1 = "478ac6c952fddd4399e71d4779797c538d0ff2bf" +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "716e24b21538abc91f6205fd1d8363f39b442851" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.5.8" +version = "2.7.2" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] @@ -710,9 +710,9 @@ version = "1.1.2" [[deps.Preferences]] deps = ["TOML"] -git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d" +git-tree-sha1 = "7eb1686b4f04b82f96ed7a4ea5890a4f0c7a09f1" uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.3.0" +version = "1.4.0" [[deps.PrettyTables]] deps = ["Crayons", "LaTeXStrings", "Markdown", "Printf", "Reexport", "StringManipulation", "Tables"] @@ -734,9 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "dc4c1dee6bff928e6c23b173e13392ddeae8c975" +git-tree-sha1 = "17e39d318a6a158072d9b0f323e6b0a92d276e9c" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.6" +version = "0.32.5" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -776,9 +776,9 @@ version = "0.7.0" [[deps.SQLite_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "54d66b0f69f4578f4988fc08d579783fcdcd764f" +git-tree-sha1 = "4619dd3363610d94fb42a95a6dc35b526a26d0ef" uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" -version = "3.41.0+0" +version = "3.42.0+0" [[deps.SentinelArrays]] deps = ["Dates", "Random"] @@ -795,12 +795,6 @@ git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" version = "1.1.1" -[[deps.SnoopPrecompile]] -deps = ["Preferences"] -git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" -uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" -version = "1.0.3" - [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -816,9 +810,9 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[deps.SpecialFunctions]] deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "ef28127915f4229c971eb43f3fc075dd3fe91880" +git-tree-sha1 = "7beb031cf8145577fbccacd94b8a8f4ce78428d3" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.2.0" +version = "2.3.0" [[deps.StackViews]] deps = ["OffsetArrays"] @@ -828,14 +822,14 @@ version = "0.1.1" [[deps.StaticArrays]] deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "b8d897fe7fa688e93aef573711cb207c08c9e11e" +git-tree-sha1 = "9cabadf6e7cd2349b6cf49f1915ad2028d65e881" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.5.19" +version = "1.6.2" [[deps.StaticArraysCore]] -git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a" +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.0" +version = "1.4.2" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] @@ -892,14 +886,14 @@ version = "0.16.0+0" [[deps.TranscodingStreams]] deps = ["Random", "Test"] -git-tree-sha1 = "94f38103c984f89cf77c402f2a68dbd870f8165f" +git-tree-sha1 = "9a6ae7ed916312b41236fcef7e0af564ef934769" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.11" +version = "0.9.13" [[deps.URIs]] -git-tree-sha1 = "074f993b0ca030848b897beff716d93aca60f06a" +git-tree-sha1 = "b7a5e99f24892b6824a954199a45e9ffcc1c70f0" uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.4.2" +version = "1.5.0" [[deps.UUIDs]] deps = ["Random", "SHA"] @@ -944,9 +938,9 @@ version = "1.2.12+3" [[deps.Zstd_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "c6edfe154ad7b313c01aceca188c05c835c67360" +git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c" uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.4+0" +version = "1.5.5+0" [[deps.boost_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] @@ -985,4 +979,4 @@ version = "17.4.0+0" deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Pkg", "Zlib_jll"] git-tree-sha1 = "985c1da710b0e43f7c52f037441021dfd0e3be14" uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" -version = "1.1.9+1" +version = "1.1.9+1" \ No newline at end of file From f9031a8414e013250891dd4d69f89926c23bd15c Mon Sep 17 00:00:00 2001 From: "Rathod, Bhavesh" Date: Tue, 22 Aug 2023 15:46:02 -0400 Subject: [PATCH 85/92] Update Manifest.toml Forgot to update REopt itself to latest version! --- julia_src/Manifest.toml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 8e34a3e29..7e674d092 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -420,10 +420,10 @@ uuid = "4138dd39-2aa7-5051-a626-17a0bb65d9c8" version = "0.13.3" [[deps.JLLWrappers]] -deps = ["Preferences"] -git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1" +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.4.1" +version = "1.5.0" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -524,9 +524,9 @@ version = "2.12.0+0" [[deps.LogExpFunctions]] deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "c3ce8e7420b3a6e071e0fe4745f5d4300e37b13f" +git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.24" +version = "0.3.26" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -545,9 +545,9 @@ version = "1.9.3+0" [[deps.MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "42324d08725e200c23d4dfb549e0d5d89dede2d2" +git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.10" +version = "0.5.11" [[deps.MappedArrays]] git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" @@ -734,9 +734,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "17e39d318a6a158072d9b0f323e6b0a92d276e9c" +git-tree-sha1 = "dc4c1dee6bff928e6c23b173e13392ddeae8c975" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.5" +version = "0.32.6" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -766,9 +766,9 @@ version = "1.3.0" [[deps.Roots]] deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "de432823e8aab4dd1a985be4be768f95acf152d4" +git-tree-sha1 = "ff42754a57bb0d6dcfe302fd0d4272853190421f" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.17" +version = "2.0.19" [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" @@ -810,9 +810,9 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[deps.SpecialFunctions]] deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "7beb031cf8145577fbccacd94b8a8f4ce78428d3" +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.3.0" +version = "2.3.1" [[deps.StackViews]] deps = ["OffsetArrays"] @@ -904,9 +904,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] -git-tree-sha1 = "64eb17acef1d9734cf09967539818f38093d9b35" +git-tree-sha1 = "607c142139151faa591b5e80d8055a15e487095b" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.16.2" +version = "1.16.3" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] @@ -979,4 +979,4 @@ version = "17.4.0+0" deps = ["Artifacts", "JLLWrappers", "LZO_jll", "Libdl", "Pkg", "Zlib_jll"] git-tree-sha1 = "985c1da710b0e43f7c52f037441021dfd0e3be14" uuid = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" -version = "1.1.9+1" \ No newline at end of file +version = "1.1.9+1" From 27c5fdf90e2f1b8a1482745e56ba5e7b8a38bd10 Mon Sep 17 00:00:00 2001 From: adfarth Date: Wed, 30 Aug 2023 09:37:31 -0600 Subject: [PATCH 86/92] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aa72d6459..88a87b64b 100755 --- a/README.md +++ b/README.md @@ -5,27 +5,29 @@ The REoptĀ® model in this repository is a free, open-source, development version The REopt API provides concurrent, multiple technology integration and optimization capabilities to help organizations meet their cost savings, energy performance, resilience, and emissions reduction goals. Formulated as a mixed integer linear program, the REopt model recommends an optimally sized mix of renewable energy, conventional generation, and energy storage technologies; estimates the net present value of implementing those technologies; and provides a dispatch strategy for operating the technology mix at maximum economic efficiency. A list of the REopt model capabilities is provided [here](https://reopt.nrel.gov/about/capabilities.html). Example projects using REopt can be viewed [here](https://reopt.nrel.gov/projects/). ## Should I be using or modifying the REopt API or the REopt Julia Package? + The REopt Julia package will soon become the backend of the REopt API. That means that the optimization model will be contained in [REopt.jl](https://github.com/NREL/REopt.jl), and that a user could supply the same inputs to the API and Julia package and get the same results. So which should you use? -**When and how to use the REopt Julia package:** + +**1. When and how to _use_ the REopt Julia package:** - You want to be able to use the REopt model without incorporating an API call (and associated rate limits). - You want slightly more flexibility in how you interact with model inputs, optimization parameters, and run types. - You can install an optimization solver for use with REopt. - You do not need your results saved in an external database. - **How do I use the REopt Julia package?:** see instructions [here](https://nrel.github.io/REopt.jl/dev/). -**When and how to modify the REopt Julia package:** +**2. When and how to _modify_ the REopt Julia package:** - You want to make changes to the REopt model beyond modifying input values (e.g., add a new technology). - You want to suggest a bug fix in the REopt model. - **How do I modify the REopt Julia package?:** get the (free, open-source) model [here](https://github.com/NREL/REopt.jl) and see additional instructions [here](https://nrel.github.io/REopt.jl/dev/). -**When and how to use the REopt_API:** +**3. When and how to _use_ the REopt_API:** - You do not want to modify the code or host the API on your own server. - You do not want to install or use your own optimization solver (simply POSTing to the REopt API does not require a solver, whereas using the Julia package does). - You want to be able to access or share results saved in a database using a runuuid. - You want to be able to view your API results in the REopt web tool using a runuuid. (we can do this?) - **How do I use the REopt API?:** you can access our production version of the API via the [NREL Developer Network](https://developer.nrel.gov/docs/energy-optimization/reopt/). You can view examples of using the API in the [REopt-API-Analysis Repo](https://github.com/NREL/REopt-API-Analysis/wiki). -**When and how to modify the REopt_API:** +**4. When and how to _modify_ the REopt_API:** - You have made changes to the REopt Julia package that include modified inputs or outputs, and want to reflect those in the REopt API. - You want to suggest a bug fix in the REopt API or add or modify validation or API endpoints. - You want to host the API on your own servers. From b108bcbb796029a60326ff0f182c007a44405310 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 1 Sep 2023 10:02:03 -0600 Subject: [PATCH 87/92] Merge migrations after develop merge --- reoptjl/migrations/0041_merge_20230901_1601.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 reoptjl/migrations/0041_merge_20230901_1601.py diff --git a/reoptjl/migrations/0041_merge_20230901_1601.py b/reoptjl/migrations/0041_merge_20230901_1601.py new file mode 100644 index 000000000..bb6b260c2 --- /dev/null +++ b/reoptjl/migrations/0041_merge_20230901_1601.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.7 on 2023-09-01 16:01 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('reoptjl', '0040_boilerinputs_boileroutputs_steamturbineinputs_and_more'), + ('reoptjl', '0040_merge_20230815_2047'), + ] + + operations = [ + ] From bff82a54144d797f35e5817d1f8fa18f5217d808 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 1 Sep 2023 21:32:46 -0600 Subject: [PATCH 88/92] Update REopt.jl to v0.32.7 --- julia_src/Manifest.toml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 7e674d092..3d03e23d6 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -210,9 +210,9 @@ version = "1.15.1" [[deps.DiskArrays]] deps = ["OffsetArrays"] -git-tree-sha1 = "7e8dcba9d1d1ba8aa576f7d899d42e04d76431b2" +git-tree-sha1 = "1eb57cdbf33f945ccfaf27f45bff461c47d9cab7" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" -version = "0.3.15" +version = "0.3.16" [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] @@ -337,10 +337,10 @@ uuid = "c8ec2601-a99c-407f-b158-e79c03c2f5f7" version = "0.1.1" [[deps.HDF5]] -deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires", "UUIDs"] -git-tree-sha1 = "c73fdc3d9da7700691848b78c61841274076932a" +deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Printf", "Random", "Requires", "UUIDs"] +git-tree-sha1 = "114e20044677badbc631ee6fdc80a67920561a29" uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.16.15" +version = "0.16.16" [[deps.HDF5_jll]] deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] @@ -362,9 +362,9 @@ version = "0.9.4" [[deps.InfrastructureModels]] deps = ["JuMP", "Memento"] -git-tree-sha1 = "dc1e2eba1a98aa457b629fe1723d9078ecb74340" +git-tree-sha1 = "f9c1f6bdac8ad3fca6fc24fcf68256958ad84c28" uuid = "2030c09a-7f63-5d83-885d-db604e0e9cc0" -version = "0.7.7" +version = "0.7.8" [[deps.IniFile]] git-tree-sha1 = "f550e6e32074c939295eb5ea6de31849ac2c9625" @@ -495,10 +495,10 @@ version = "1.10.2+0" uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" [[deps.Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "c7cb1f5d892775ba13767a87c7ada0b980ea0a71" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.16.1+2" +version = "1.17.0+0" [[deps.Libtiff_jll]] deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] @@ -538,10 +538,10 @@ uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" version = "0.4.9" [[deps.Lz4_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "5d494bc6e85c4c9b626ee0cab05daa4085486ab1" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" -version = "1.9.3+0" +version = "1.9.4+0" [[deps.MacroTools]] deps = ["Markdown", "Random"] @@ -704,9 +704,9 @@ version = "0.14.9" [[deps.PrecompileTools]] deps = ["Preferences"] -git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.1.2" +version = "1.2.0" [[deps.Preferences]] deps = ["TOML"] @@ -904,9 +904,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[deps.Unitful]] deps = ["ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "Random"] -git-tree-sha1 = "607c142139151faa591b5e80d8055a15e487095b" +git-tree-sha1 = "a72d22c7e13fe2de562feda8645aa134712a87ee" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.16.3" +version = "1.17.0" [[deps.WeakRefStrings]] deps = ["DataAPI", "InlineStrings", "Parsers"] @@ -920,10 +920,10 @@ uuid = "76eceee3-57b5-4d4a-8e66-0e911cebbf60" version = "1.6.1" [[deps.XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "93c41695bc1c08c46c5899f4fe06d6ead504bb73" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] +git-tree-sha1 = "04a51d15436a572301b5abbb9d099713327e9fc4" uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.10.3+0" +version = "2.10.4+0" [[deps.Xpress]] deps = ["Libdl", "LinearAlgebra", "MathOptInterface", "SparseArrays"] From b1b2a1e804760809bae47f0e666cd7da46b8bb2d Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sat, 2 Sep 2023 07:08:15 -0600 Subject: [PATCH 89/92] ACTUALLY update REopt.jl to v0.32.7 Was too quick to update after Julia merged new REopt version into master registry --- julia_src/Manifest.toml | 126 ++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 68 deletions(-) diff --git a/julia_src/Manifest.toml b/julia_src/Manifest.toml index 3d03e23d6..f537c70df 100644 --- a/julia_src/Manifest.toml +++ b/julia_src/Manifest.toml @@ -37,9 +37,9 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.AxisArrays]] deps = ["Dates", "IntervalSets", "IterTools", "RangeArrays"] -git-tree-sha1 = "1dd4d9f5beebac0c03446918741b1a03dc5e5788" +git-tree-sha1 = "16351be62963a67ac4083f748fdb3cca58bfd52f" uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9" -version = "0.4.6" +version = "0.4.7" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -50,6 +50,11 @@ git-tree-sha1 = "d9a9701b899b30332bbcb3e1679c41cce81fb0e8" uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" version = "1.3.2" +[[deps.BitFlags]] +git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.7" + [[deps.Blosc]] deps = ["Blosc_jll"] git-tree-sha1 = "310b77648d38c223d947ff3f50f511d08690b8d5" @@ -143,6 +148,12 @@ deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "1.0.1+0" +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "5372dbbf8f0bdb8c700db5367132925c0771ef7e" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.2.1" + [[deps.ConstructionBase]] deps = ["LinearAlgebra"] git-tree-sha1 = "fe2838a593b5f776e1597e086dcd47560d94e816" @@ -214,10 +225,6 @@ git-tree-sha1 = "1eb57cdbf33f945ccfaf27f45bff461c47d9cab7" uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3" version = "0.3.16" -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - [[deps.DocStringExtensions]] deps = ["LibGit2"] git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" @@ -229,6 +236,12 @@ deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" version = "1.6.0" +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + [[deps.Expat_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" @@ -246,12 +259,6 @@ git-tree-sha1 = "299dc33549f68299137e51e6d49a13b5b1da9673" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" version = "1.16.1" -[[deps.FilePaths]] -deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"] -git-tree-sha1 = "919d9412dbf53a2e6fe74af62a73ceed0bce0629" -uuid = "8fc22ac5-c921-52a6-82fd-178b2807b824" -version = "0.8.3" - [[deps.FilePathsBase]] deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"] git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12" @@ -319,11 +326,6 @@ repo-url = "https://github.com/NREL/GhpGhx.jl.git" uuid = "7ce85f02-24a8-4d69-a3f0-14b5daa7d30c" version = "0.1.0" -[[deps.Glob]] -git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" -uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" -version = "1.3.1" - [[deps.Graphics]] deps = ["Colors", "LinearAlgebra", "NaNMath"] git-tree-sha1 = "d61890399bc535850c4bf08e4e0d3a7ad0f21cbd" @@ -349,10 +351,10 @@ uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" version = "1.12.2+2" [[deps.HTTP]] -deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"] -git-tree-sha1 = "0fa77022fe4b511826b39c894c90daf5fce3334a" +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "cb56ccdd481c0dd7f975ad2b3b62d9eda088f7e2" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "0.9.17" +version = "1.9.14" [[deps.ImageCore]] deps = ["AbstractFFTs", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Graphics", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "Reexport"] @@ -360,17 +362,6 @@ git-tree-sha1 = "acf614720ef026d38400b3817614c45882d75500" uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534" version = "0.9.4" -[[deps.InfrastructureModels]] -deps = ["JuMP", "Memento"] -git-tree-sha1 = "f9c1f6bdac8ad3fca6fc24fcf68256958ad84c28" -uuid = "2030c09a-7f63-5d83-885d-db604e0e9cc0" -version = "0.7.8" - -[[deps.IniFile]] -git-tree-sha1 = "f550e6e32074c939295eb5ea6de31849ac2c9625" -uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" -version = "0.5.1" - [[deps.InlineStrings]] deps = ["Parsers"] git-tree-sha1 = "9cc2baf75c6d09f9da536ddf58eb2f29dedaf461" @@ -427,9 +418,9 @@ version = "1.5.0" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e" +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.3" +version = "0.21.4" [[deps.JpegTurbo_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -438,10 +429,10 @@ uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" version = "2.1.91+0" [[deps.JuMP]] -deps = ["LinearAlgebra", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SparseArrays"] -git-tree-sha1 = "9a57156b97ed7821493c9c0a65f5b72710b38cf7" +deps = ["LinearAlgebra", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SnoopPrecompile", "SparseArrays"] +git-tree-sha1 = "f09279ee9b4f80aaacaf2ac801429dd0c16c57ed" uuid = "4076af6c-e467-56ae-b986-b466b2749572" -version = "1.4.0" +version = "1.14.0" [[deps.Kerberos_krb5_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -507,10 +498,10 @@ uuid = "89763e89-9b03-5906-acba-b20f662cd828" version = "4.4.0+0" [[deps.LinDistFlow]] -deps = ["JuMP", "LinearAlgebra", "PowerModelsDistribution", "SparseArrays"] -git-tree-sha1 = "c6c652ab975386cab61559e4ac861e8f75932e94" +deps = ["JuMP", "LinearAlgebra", "Logging", "SparseArrays"] +git-tree-sha1 = "ad15878e716a18b82325cacc02af4533bb9777e7" uuid = "bf674bac-ffe4-48d3-9f32-72124ffa9ede" -version = "0.2.0" +version = "0.1.4" [[deps.LinearAlgebra]] deps = ["Libdl", "libblastrampoline_jll"] @@ -533,9 +524,9 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.LoggingExtras]] deps = ["Dates", "Logging"] -git-tree-sha1 = "5d4d2d9904227b8bd66386c1138cf4d5ffa826bf" +git-tree-sha1 = "0d097476b6c381ab7906460ef1ef1638fbce1d91" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" -version = "0.4.9" +version = "1.0.2" [[deps.Lz4_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -559,10 +550,10 @@ deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MathOptInterface]] -deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] -git-tree-sha1 = "ceed48edffe0325a6e9ea00ecf3607af5089c413" +deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] +git-tree-sha1 = "f4e059d60f10ffa61f897c10f7fbdb8eed895e95" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.9.0" +version = "1.19.0" [[deps.MbedTLS]] deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "Random", "Sockets"] @@ -575,12 +566,6 @@ deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" version = "2.28.0+0" -[[deps.Memento]] -deps = ["Dates", "Distributed", "Requires", "Serialization", "Sockets", "Test", "UUIDs"] -git-tree-sha1 = "bb2e8f4d9f400f6e90d57b34860f6abdc51398e5" -uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" -version = "1.4.1" - [[deps.Missings]] deps = ["DataAPI"] git-tree-sha1 = "f66bdc5de519e8f8ae43bdc598782d35a25b1272" @@ -602,9 +587,9 @@ version = "2022.2.1" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] -git-tree-sha1 = "1d57a7dc42d563ad6b5e95d7a8aebd550e5162c0" +git-tree-sha1 = "5879579adbd9bc3017fe63c766371aace1a1d641" uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" -version = "1.0.5" +version = "1.3.1" [[deps.NaNMath]] deps = ["OpenLibm_jll"] @@ -644,6 +629,12 @@ deps = ["Artifacts", "Libdl"] uuid = "05823500-19ac-5b8b-9628-191a04bc5112" version = "0.8.1+0" +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.4.1" + [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] git-tree-sha1 = "bbb5c2115d63c2f1451cb70e5ef75e8fe4707019" @@ -684,24 +675,12 @@ deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markd uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" version = "1.8.0" -[[deps.PolyhedralRelaxations]] -deps = ["DataStructures", "ForwardDiff", "JuMP", "Logging", "LoggingExtras"] -git-tree-sha1 = "05f2adc696ae9a99be3de99dd8970d00a4dccefe" -uuid = "2e741578-48fa-11ea-2d62-b52c946f73a0" -version = "0.3.5" - [[deps.PooledArrays]] deps = ["DataAPI", "Future"] git-tree-sha1 = "a6062fe4063cdafe78f4a0a81cfffb89721b30e7" uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" version = "1.4.2" -[[deps.PowerModelsDistribution]] -deps = ["CSV", "Dates", "FilePaths", "Glob", "InfrastructureModels", "JSON", "JuMP", "LinearAlgebra", "Logging", "LoggingExtras", "PolyhedralRelaxations", "SparseArrays", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "60b4d3446f0ddce0f86ec779438c7fa3772ca216" -uuid = "d7431456-977f-11e9-2de3-97ff7677985e" -version = "0.14.9" - [[deps.PrecompileTools]] deps = ["Preferences"] git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" @@ -734,9 +713,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" [[deps.REopt]] deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"] -git-tree-sha1 = "dc4c1dee6bff928e6c23b173e13392ddeae8c975" +git-tree-sha1 = "f0bb76959fb18989d9cc8510a9fd06e37564c3bf" uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6" -version = "0.32.6" +version = "0.32.7" [[deps.Random]] deps = ["SHA", "Serialization"] @@ -795,6 +774,17 @@ git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" version = "1.1.1" +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + +[[deps.SnoopPrecompile]] +deps = ["Preferences"] +git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" +uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" +version = "1.0.3" + [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -927,9 +917,9 @@ version = "2.10.4+0" [[deps.Xpress]] deps = ["Libdl", "LinearAlgebra", "MathOptInterface", "SparseArrays"] -git-tree-sha1 = "fac5fe95ce2f540058195e8b8c2cb9f894ada64c" +git-tree-sha1 = "502f7c1142f5233137fa02e27b22d150b78a6db3" uuid = "9e70acf3-d6c9-5be6-b5bd-4e2c73e3e054" -version = "0.15.5" +version = "0.16.1" [[deps.Zlib_jll]] deps = ["Libdl"] From 6d5ea66df0259ce4efc9ad85ca422e7204769631 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Sun, 3 Sep 2023 09:44:19 -0600 Subject: [PATCH 90/92] Update HTTP.jl register call for updated version --- julia_src/http.jl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/julia_src/http.jl b/julia_src/http.jl index 1100a20b2..d980969d3 100644 --- a/julia_src/http.jl +++ b/julia_src/http.jl @@ -484,17 +484,17 @@ end # define REST endpoints to dispatch to "service" functions const ROUTER = HTTP.Router() -HTTP.@register(ROUTER, "POST", "/job", job) -HTTP.@register(ROUTER, "POST", "/reopt", reopt) -HTTP.@register(ROUTER, "POST", "/erp", erp) -HTTP.@register(ROUTER, "POST", "/ghpghx", ghpghx) -HTTP.@register(ROUTER, "GET", "/chp_defaults", chp_defaults) -HTTP.@register(ROUTER, "GET", "/emissions_profile", emissions_profile) -HTTP.@register(ROUTER, "GET", "/easiur_costs", easiur_costs) -HTTP.@register(ROUTER, "GET", "/simulated_load", simulated_load) -HTTP.@register(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller_defaults) -HTTP.@register(ROUTER, "GET", "/ghp_efficiency_thermal_factors", ghp_efficiency_thermal_factors) -HTTP.@register(ROUTER, "GET", "/ground_conductivity", ground_conductivity) -HTTP.@register(ROUTER, "GET", "/health", health) -HTTP.@register(ROUTER, "GET", "/get_existing_chiller_default_cop", get_existing_chiller_default_cop) +HTTP.register!(ROUTER, "POST", "/job", job) +HTTP.register!(ROUTER, "POST", "/reopt", reopt) +HTTP.register!(ROUTER, "POST", "/erp", erp) +HTTP.register!(ROUTER, "POST", "/ghpghx", ghpghx) +HTTP.register!(ROUTER, "GET", "/chp_defaults", chp_defaults) +HTTP.register!(ROUTER, "GET", "/emissions_profile", emissions_profile) +HTTP.register!(ROUTER, "GET", "/easiur_costs", easiur_costs) +HTTP.register!(ROUTER, "GET", "/simulated_load", simulated_load) +HTTP.register!(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller_defaults) +HTTP.register!(ROUTER, "GET", "/ghp_efficiency_thermal_factors", ghp_efficiency_thermal_factors) +HTTP.register!(ROUTER, "GET", "/ground_conductivity", ground_conductivity) +HTTP.register!(ROUTER, "GET", "/health", health) +HTTP.register!(ROUTER, "GET", "/get_existing_chiller_default_cop", get_existing_chiller_default_cop) HTTP.serve(ROUTER, "0.0.0.0", 8081, reuseaddr=true) From 134713001de6fba6fd49bd6d0842a1c0f07865a1 Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Sun, 3 Sep 2023 19:46:06 -0600 Subject: [PATCH 91/92] Delete dummy_file.txt --- dummy_file.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 dummy_file.txt diff --git a/dummy_file.txt b/dummy_file.txt deleted file mode 100644 index aac8259a2..000000000 --- a/dummy_file.txt +++ /dev/null @@ -1,3 +0,0 @@ -This is a dummy file commited to erp-main branch so that the master branch -does not think this branch has already been merged and therefore undeploys -it from the staging server when master is deployed. \ No newline at end of file From 8a4fd4e9910faa54b6b268bff8961ecf032ed873 Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Sun, 3 Sep 2023 21:05:44 -0600 Subject: [PATCH 92/92] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89d069bbf..2b6a4e942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ Classify the change according to the following categories: ##### Removed ### Patches -## Develop 2023-08-07 +## v2.15.0 ### Minor Updates ##### Added - Add `GHP` to `reoptjl` app for v3