From 2815834d969b659947b82199b7b61b87ddf9b27e Mon Sep 17 00:00:00 2001 From: bill-becker Date: Wed, 28 Dec 2022 22:48:54 -0700 Subject: [PATCH 1/6] Add addressable_load_fraction to HeatingLoads Also revise some help text for other fields --- ...puts_addressable_load_fraction_and_more.py | 35 ++++++++++++++++ job/models.py | 41 ++++++++++++++++--- 2 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 job/migrations/0017_domestichotwaterloadinputs_addressable_load_fraction_and_more.py diff --git a/job/migrations/0017_domestichotwaterloadinputs_addressable_load_fraction_and_more.py b/job/migrations/0017_domestichotwaterloadinputs_addressable_load_fraction_and_more.py new file mode 100644 index 000000000..d4fa1ba9c --- /dev/null +++ b/job/migrations/0017_domestichotwaterloadinputs_addressable_load_fraction_and_more.py @@ -0,0 +1,35 @@ +# Generated by Django 4.0.7 on 2022-12-29 05:39 + +import django.contrib.postgres.fields +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0016_coldthermalstorageinputs_coldthermalstorageoutputs_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='domestichotwaterloadinputs', + name='addressable_load_fraction', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1.0)]), blank=True, default=list, help_text='Fraction of input fuel load which is addressable by heating technologies (default is 1.0).Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.', size=None), + ), + migrations.AddField( + model_name='spaceheatingloadinputs', + name='addressable_load_fraction', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1.0)]), blank=True, default=list, help_text='Fraction of input fuel load which is addressable by heating technologies (default is 1.0).Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.', size=None), + ), + migrations.AlterField( + model_name='chpinputs', + name='fuel_cost_per_mmbtu', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='The `fuel_cost_per_mmbtu` is a required input and can be a scalar, a list of 12 monthly values, or a time series of values for every time step.', size=None), + ), + migrations.AlterField( + model_name='spaceheatingloadinputs', + name='fuel_loads_mmbtu_per_hour', + field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True), blank=True, default=list, help_text='Vector of space heating fuel loads [mmbtu/hr] over one year. Must be hourly (8,760 samples), 30 minute (17,520 samples), or 15 minute (35,040 samples). All non-net load values must be greater than or equal to zero. ', size=None), + ), + ] diff --git a/job/models.py b/job/models.py index 5d1a2fab7..f79e823e1 100644 --- a/job/models.py +++ b/job/models.py @@ -3367,10 +3367,7 @@ class CHPInputs(BaseModel, models.Model): null=False, blank=True, help_text=( - "The CHP system fuel cost is a required input when the CHP system is included as an option." - "The `fuel_cost_per_mmbtu` can be a scalar, a list of 12 monthly values, or a time series of values for every time step." - "If a scalar or a vector of 12 values are provided, then the value is scaled up to 8760 values." - "If a vector of 8760, 17520, or 35040 values is provided, it is adjusted to match timesteps per hour in the optimization." + "The `fuel_cost_per_mmbtu` is a required input and can be a scalar, a list of 12 monthly values, or a time series of values for every time step." ) ) @@ -5036,7 +5033,7 @@ class SpaceHeatingLoadInputs(BaseModel, models.Model): ), default=list, blank=True, - help_text=("Typical load over all hours in one year. Must be hourly (8,760 samples), 30 minute (17," + help_text=("Vector of space heating fuel loads [mmbtu/hr] over one year. Must be hourly (8,760 samples), 30 minute (17," "520 samples), or 15 minute (35,040 samples). All non-net load values must be greater than or " "equal to zero. " ) @@ -5068,6 +5065,20 @@ class SpaceHeatingLoadInputs(BaseModel, models.Model): "DoE Commercial Reference Buildings. Must sum to 1.0.") ) + addressable_load_fraction = ArrayField( + models.FloatField( + validators=[ + MinValueValidator(0), + MaxValueValidator(1.0) + ], + blank=True + ), + default=list, + blank=True, + help_text=( "Fraction of input fuel load which is addressable by heating technologies (default is 1.0)." + "Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.") + ) + ''' Latitude and longitude are passed on to SpaceHeating struct using the Site struct. City is not used as an input here because it is found using find_ashrae_zone_city() when needed. @@ -5091,6 +5102,9 @@ def clean(self): if self.doe_reference_name != "" or \ len(self.blended_doe_reference_names) > 0: self.year = 2017 # the validator provides an "info" message regarding this) + + if self.addressable_load_fraction == None: + self.addressable_load_fraction = list([1.0]) # should not convert to timeseries, in case it is to be used with monthly_mmbtu or annual_mmbtu if error_messages: raise ValidationError(error_messages) @@ -5212,6 +5226,20 @@ class DomesticHotWaterLoadInputs(BaseModel, models.Model): "DoE Commercial Reference Buildings to simulate buildings/campuses. Must sum to 1.0.") ) + addressable_load_fraction = ArrayField( + models.FloatField( + validators=[ + MinValueValidator(0), + MaxValueValidator(1.0) + ], + blank=True + ), + default=list, + blank=True, + help_text=( "Fraction of input fuel load which is addressable by heating technologies (default is 1.0)." + "Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.") + ) + ''' Latitude and longitude are passed on to DomesticHotWater struct using the Site struct. City is not used as an input here because it is found using find_ashrae_zone_city() when needed. @@ -5236,6 +5264,9 @@ def clean(self): if self.doe_reference_name != "" or \ len(self.blended_doe_reference_names) > 0: self.year = 2017 # the validator provides an "info" message regarding this) + + if self.addressable_load_fraction == None: + self.addressable_load_fraction = list([1.0]) # should not convert to timeseries, in case it is to be used with monthly_mmbtu or annual_mmbtu class HeatingLoadOutputs(BaseModel, models.Model): From 75595ff8034f7c23f5e213108f7fce71a8e02497 Mon Sep 17 00:00:00 2001 From: bill-becker Date: Fri, 6 Jan 2023 10:11:19 -0700 Subject: [PATCH 2/6] Change redis memory policy to allkeys-lru Was volitile-lru --- .helm/templates/redis-stateful-set.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.helm/templates/redis-stateful-set.yaml b/.helm/templates/redis-stateful-set.yaml index a66a152f0..339705613 100644 --- a/.helm/templates/redis-stateful-set.yaml +++ b/.helm/templates/redis-stateful-set.yaml @@ -20,7 +20,7 @@ spec: containers: - name: {{ .Chart.Name }}-redis image: redis:6.0.8-alpine - args: ["sh", "-c", "redis-server --requirepass $$REDIS_PASSWORD --save 900 1 --save 300 10 --save 60 10000 --appendonly yes --maxmemory 2048mb --maxmemory-policy volatile-lru"] + args: ["sh", "-c", "redis-server --requirepass $$REDIS_PASSWORD --save 900 1 --save 300 10 --save 60 10000 --appendonly yes --maxmemory 2048mb --maxmemory-policy allkeys-lru"] # volumeMounts: # - name: {{ .Chart.Name }}-redis-data-volume # mountPath: /data From 3f5a31070724039918c7d58be7c79c92a0c028e9 Mon Sep 17 00:00:00 2001 From: adfarth Date: Thu, 12 Jan 2023 10:28:57 -0700 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b951636..ae0197c0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ Classify the change according to the following categories: ##### Removed ### Patches -## Develop - 2022-01-11 +## v2.7.0 ### Minor Updates ### Changed - In job/ app (v3): Name changes for many outputs/results. Generally, changes are for energy outputs (not costs) that include "year_one", and are changed to annual_ for scalars and to production_to_, thermal_to_ etc. for time series. From 1c2d3c29c025dc274b6bcc46d4fa078a7d43a71a Mon Sep 17 00:00:00 2001 From: adfarth Date: Thu, 12 Jan 2023 10:34:20 -0700 Subject: [PATCH 4/6] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae0197c0d..e989d85de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,10 @@ Classify the change according to the following categories: ##### Removed ### Patches +## Develop +### Minor Updates +### Added + - In job/ app (v3): Added **addressable_load_fraction** to SpaceHeatingLoad and DomesticHotWaterLoad inputs. ## v2.7.0 ### Minor Updates ### Changed From 1c75d3d79fd45845a4142f81261fa6d4d7cd3902 Mon Sep 17 00:00:00 2001 From: adfarth Date: Thu, 12 Jan 2023 10:49:36 -0700 Subject: [PATCH 5/6] Create 0021_merge_20230112_1748.py --- job/migrations/0021_merge_20230112_1748.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 job/migrations/0021_merge_20230112_1748.py diff --git a/job/migrations/0021_merge_20230112_1748.py b/job/migrations/0021_merge_20230112_1748.py new file mode 100644 index 000000000..c75461d8e --- /dev/null +++ b/job/migrations/0021_merge_20230112_1748.py @@ -0,0 +1,14 @@ +# Generated by Django 4.0.7 on 2023-01-12 17:48 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('job', '0017_domestichotwaterloadinputs_addressable_load_fraction_and_more'), + ('job', '0020_chpoutputs_thermal_production_series_mmbtu_per_hour'), + ] + + operations = [ + ] From 4e04d403df9552971b063d87fd7356ccf0c0ce51 Mon Sep 17 00:00:00 2001 From: Bill Becker <42586683+Bill-Becker@users.noreply.github.com> Date: Fri, 13 Jan 2023 09:36:11 -0700 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e989d85de..3cea3c26f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,9 @@ Classify the change according to the following categories: ### Minor Updates ### Added - In job/ app (v3): Added **addressable_load_fraction** to SpaceHeatingLoad and DomesticHotWaterLoad inputs. +### Changed + - Changed redis service memory settings to mitigate "out of memory" OOM issue we've been getting on production + ## v2.7.0 ### Minor Updates ### Changed