Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/inputs-outputs' into chp-default…
Browse files Browse the repository at this point in the history
…s-mod
  • Loading branch information
Bill-Becker committed Mar 17, 2023
2 parents 710d154 + 393aa34 commit be5765f
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 30 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Classify the change according to the following categories:
##### Removed
### Patches


## v2.9.0
### Minor Updates
##### Added
Expand All @@ -37,6 +38,7 @@ Classify the change according to the following categories:
- `/erp/help` endpoint that GETs the ERP input field info (calls `erp_help()`)
- `/erp/chp_defaults` endpoint that GETs ERP CHP/prime generator input defaults based on parameters `prime_mover`, `is_chp`, and `size_kw` (calls `erp_chp_prime_gen_defaults()`)
- Tests in `resilience+stats/tests/test_erp.py`
- In job/ app (v3), added Financial **year_one_om_costs_before_tax_bau**, **lifecycle_om_costs_after_tax_bau**
- Added field **production_factor_series** to Django models **WindOutputs** and **PVOutputs**
- In **REoptjlMessageOutputs** added a **has_stacktrace** field to denote if response has a stacktrace error or not. Default is False.
- Added access to the multiple outage stochastic/robust modeling capabilities in REopt.jl. Not all inputs and outputs are exposed, but the following are:
Expand All @@ -46,6 +48,8 @@ Classify the change according to the following categories:
- Added test using multiple outage modeling
- Add /dev/schedule_stats endpoint
##### Changed
- In job/ app (v3), changed Financial **breakeven_cost_of_emissions_reduction_per_tonnes_CO2** to **breakeven_cost_of_emissions_reduction_per_tonne_CO2**
- In job/ app (v3), changed default ElectricLoad **year** to 2022 if user provides load data and 2017 if using CRBD
- Changed `scalar_to_vector` helper function to `scalar_or_monthly_to_8760`
- Changed **GeneratorInputs** fields **fuel_slope_gal_per_kwh** and **fuel_intercept_gal_per_hr** to **electric_efficiency_full_load** and **electric_efficiency_half_load** to represent the same fuel burn curve in a different way consistent with **CHPInputs**
- Updated the following default values to job/ app (v3):
Expand All @@ -65,6 +69,8 @@ Classify the change according to the following categories:
- Hot Water Storage and Cold Water Storage: **macrs_option_years** to 7 years
Use TransactionTestCase instead of TestCase (this avoids whole test being wrapped in a transaction which leads to a TransactionManagementError when doing a database query in the middle)
- Updated ubuntu-18.04 to ubuntu-latest in GitHub push/pull tests because 18.04 was deprecated in GitHub Actions
##### Fixed
- In reo (v2), calculation of `net_capital_costs_plus_om` was previously missing addition sign for fuel charges. Corrected this equation.

## v2.8.0
### Minor Updates
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 4.0.7 on 2023-03-09 19:00

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('job', '0026_alter_chpinputs_federal_itc_fraction_and_more'),
]

operations = [
migrations.RenameField(
model_name='financialoutputs',
old_name='breakeven_cost_of_emissions_reduction_per_tonnes_CO2',
new_name='breakeven_cost_of_emissions_reduction_per_tonne_CO2',
),
migrations.AddField(
model_name='financialoutputs',
name='lifecycle_om_costs_after_tax_bau',
field=models.FloatField(blank=True, help_text='BAU Component of lifecycle costs (LCC). This value is the present value of all O&M costs, after tax in the BAU case.', null=True),
),
migrations.AddField(
model_name='financialoutputs',
name='year_one_om_costs_before_tax_bau',
field=models.FloatField(blank=True, help_text='Year one operations and maintenance cost before tax in the BAU case.', null=True),
),
migrations.AlterField(
model_name='electricloadinputs',
name='year',
field=models.IntegerField(blank=True, default=2022, help_text="Year of Custom Load Profile. If a custom load profile is uploaded via the loads_kw parameter, it is important that this year correlates with the load profile so that weekdays/weekends are determined correctly for the utility rate tariff. If a DOE Reference Building profile (aka 'simulated' profile) is used, the year is set to 2017 since the DOE profiles start on a Sunday.", null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(9999)]),
),
]
14 changes: 14 additions & 0 deletions job/migrations/0028_merge_20230309_2246.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 4.0.7 on 2023-03-09 22:46

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('job', '0027_rename_breakeven_cost_of_emissions_reduction_per_tonnes_co2_financialoutputs_breakeven_cost_of_emiss'),
('job', '0027_reoptjlmessageoutputs_has_stacktrace'),
]

operations = [
]
14 changes: 14 additions & 0 deletions job/migrations/0029_merge_20230316_1432.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 4.0.7 on 2023-03-16 14:32

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('job', '0028_merge_20230309_2246'),
('job', '0028_merge_20230314_2001'),
]

operations = [
]
12 changes: 10 additions & 2 deletions job/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,10 @@ class FinancialOutputs(BaseModel, models.Model):
null=True, blank=True,
help_text="Year one operations and maintenance cost before tax."
)
year_one_om_costs_before_tax_bau = models.FloatField(
null=True, blank=True,
help_text="Year one operations and maintenance cost before tax in the BAU case."
)
simple_payback_years = models.FloatField(
null=True, blank=True,
help_text=("Number of years until the cumulative annual cashflows turn positive. "
Expand Down Expand Up @@ -984,6 +988,10 @@ class FinancialOutputs(BaseModel, models.Model):
null=True, blank=True,
help_text=("Component of lifecycle costs (LCC). This value is the present value of all O&M costs, after tax.")
)
lifecycle_om_costs_after_tax_bau = models.FloatField(
null=True, blank=True,
help_text=("BAU Component of lifecycle costs (LCC). This value is the present value of all O&M costs, after tax in the BAU case.")
)
lifecycle_fuel_costs_after_tax = models.FloatField(
null=True, blank=True,
help_text=("Component of lifecycle costs (LCC). This value is the present value of all fuel costs over the analysis period, after tax.")
Expand Down Expand Up @@ -1047,7 +1055,7 @@ class FinancialOutputs(BaseModel, models.Model):
null=True, blank=True,
help_text="Total cost of NOx, SO2, and PM2.5 emissions associated with the site's energy consumption over the analysis period in the BAU case."
)
breakeven_cost_of_emissions_reduction_per_tonnes_CO2 = models.FloatField(
breakeven_cost_of_emissions_reduction_per_tonne_CO2 = models.FloatField(
null=True, blank=True,
help_text=("Cost of emissions required to breakeven (NPV = 0) compared to the BAU case LCC."
"If the cost of health emissions were included in the objective function,"
Expand Down Expand Up @@ -1114,7 +1122,7 @@ class ElectricLoadInputs(BaseModel, models.Model):
"https://energy.gov/eere/buildings/commercial-reference-buildings")
)
year = models.IntegerField(
default=2020,
default=2022,
validators=[
MinValueValidator(1),
MaxValueValidator(9999)
Expand Down
3 changes: 2 additions & 1 deletion job/test/posts/outage.json

Large diffs are not rendered by default.

30 changes: 4 additions & 26 deletions julia_src/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.8.5"
julia_version = "1.7.1"
manifest_format = "2.0"
project_hash = "90e66426e70d2bf97b8a3e99508fcb404743b11d"

Expand All @@ -24,7 +24,6 @@ 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"]
Expand Down Expand Up @@ -141,7 +140,6 @@ version = "4.6.1"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.0.1+0"

[[deps.ConstructionBase]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -225,9 +223,8 @@ uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.3"

[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"

[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down Expand Up @@ -258,9 +255,6 @@ 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"
Expand Down Expand Up @@ -475,12 +469,10 @@ version = "1.3.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"]
Expand All @@ -495,7 +487,6 @@ 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"
Expand Down Expand Up @@ -579,7 +570,6 @@ 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"]
Expand All @@ -604,7 +594,6 @@ version = "0.3.4"

[[deps.MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2022.2.1"

[[deps.MutableArithmetics]]
deps = ["LinearAlgebra", "SparseArrays", "Test"]
Expand All @@ -626,7 +615,6 @@ version = "400.902.5+1"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
version = "1.2.0"

[[deps.OffsetArrays]]
deps = ["Adapt"]
Expand All @@ -637,7 +625,6 @@ version = "1.12.9"
[[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"]
Expand All @@ -648,7 +635,6 @@ 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"]
Expand Down Expand Up @@ -688,7 +674,6 @@ version = "2.5.8"
[[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"]
Expand Down Expand Up @@ -772,7 +757,6 @@ version = "2.0.10"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.SQLite_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"]
Expand Down Expand Up @@ -849,7 +833,6 @@ version = "0.3.0"
[[deps.TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
version = "1.0.0"

[[deps.TableTraits]]
deps = ["IteratorInterfaceExtensions"]
Expand All @@ -866,7 +849,6 @@ version = "1.10.1"
[[deps.Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
version = "1.10.1"

[[deps.TensorCore]]
deps = ["LinearAlgebra"]
Expand All @@ -880,9 +862,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.TestEnv]]
deps = ["Pkg"]
git-tree-sha1 = "b5a483bcc8c9f0df569101df166601e5e699f346"
git-tree-sha1 = "df6f1b5f13936504ba45088e13a62a6930cdabf7"
uuid = "1e6cf692-eddd-4d53-88a5-2d735e33781b"
version = "1.9.3"
version = "1.7.4"

[[deps.Thrift_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "boost_jll"]
Expand Down Expand Up @@ -940,7 +922,6 @@ 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"]
Expand All @@ -957,7 +938,6 @@ 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"]
Expand All @@ -974,12 +954,10 @@ 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"]
Expand Down
2 changes: 1 addition & 1 deletion julia_src/reopt_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,7 @@ end
function add_util_results(m, p, r::Dict)
net_capital_costs_plus_om = value(m[:TotalTechCapCosts] + m[:TotalStorageCapCosts] + m[:GHPCapCosts]) +
value(m[:TotalPerUnitSizeOMCosts] + m[:TotalPerUnitProdOMCosts]
+ m[:TotalHourlyCHPOMCosts] + m[:GHPOMCosts]) * m[:r_tax_fraction_owner]
+ m[:TotalHourlyCHPOMCosts] + m[:GHPOMCosts]) * m[:r_tax_fraction_owner] +
value(m[:TotalFuelCharges]) * m[:r_tax_fraction_offtaker]

total_om_costs_after_tax = value(m[:TotalPerUnitSizeOMCosts] + m[:TotalPerUnitProdOMCosts]
Expand Down

0 comments on commit be5765f

Please sign in to comment.