Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 33c3c39

Browse files
committedFeb 21, 2025·
Merge branch 'main' into tsg/update_health_api_demo
2 parents 01cf06f + 53c8833 commit 33c3c39

File tree

6 files changed

+216
-98
lines changed

6 files changed

+216
-98
lines changed
 

‎notebooks/All About REM Statistics.ipynb

+90-83
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"[Monte Carlo](https://en.wikipedia.org/wiki/Monte_Carlo_method)\n",
1313
"simulation over a number of theoretical homes that closely\n",
1414
"resemble the target home and, taken as a whole, \n",
15-
"probabalistically represent it. \n",
15+
"probabilistically represent it. \n",
1616
"\n",
1717
"We do this because we generally don't know everything about each\n",
1818
"home. We have a large database of home properties\n",
@@ -22,7 +22,7 @@
2222
"[conditional probability distribution](https://github.com/NREL/resstock/tree/develop/project_national/housing_characteristics) based on the properties\n",
2323
"that we do know. We then predict the energy consumption for each \n",
2424
"sample home using a machine learning model, which yields\n",
25-
"a distribution of outcomes that probablistically represents the\n",
25+
"a distribution of outcomes that probabilistically represents the\n",
2626
"query home's energy consumption under the baseline and upgrade scenarios.\n",
2727
"We compute statistics across the this distribution to decide\n",
2828
"what is likely to happen in the query home.\n",
@@ -41,6 +41,10 @@
4141
"work, describe how they are computed, and discuss how and why\n",
4242
"they should or should not be used in particular ways.\n",
4343
"\n",
44+
"To learn more about modeling only baseline\n",
45+
"view the [REM Core Demo notebook](https://github.com/rewiringamerica/api_demos/tree/main/notebooks/REM%20Demo).\n",
46+
"\n",
47+
"\n",
4448
"## Imports and Configuration"
4549
]
4650
},
@@ -100,9 +104,9 @@
100104
"metadata": {},
101105
"outputs": [],
102106
"source": [
103-
"address = '165 Hope St, Providence, RI 02906'\n",
104-
"upgrade = \"med_eff_hp_hers_sizing_no_setback\"\n",
105-
"heating_fuel = 'fuel_oil'"
107+
"address = \"165 Hope St, Providence, RI 02906\"\n",
108+
"upgrade = \"hvac__heat_pump_seer18_hspf10\"\n",
109+
"heating_fuel = \"fuel_oil\""
106110
]
107111
},
108112
{
@@ -125,9 +129,7 @@
125129
"response = requests.get(\n",
126130
" url=REM_ADDRESS_URL,\n",
127131
" headers=headers,\n",
128-
" params=dict(\n",
129-
" address=address, upgrade=upgrade, heating_fuel=heating_fuel\n",
130-
" )\n",
132+
" params=dict(address=address, upgrade=upgrade, heating_fuel=heating_fuel),\n",
131133
")"
132134
]
133135
},
@@ -191,18 +193,18 @@
191193
{
192194
"data": {
193195
"text/plain": [
194-
"{'energy': {'mean': {'value': 1896.4884, 'units': 'gallon'},\n",
195-
" 'median': {'value': 1835.3018, 'units': 'gallon'},\n",
196-
" 'percentile_20': {'value': 1421.099, 'units': 'gallon'},\n",
197-
" 'percentile_80': {'value': 2339.4446, 'units': 'gallon'}},\n",
198-
" 'emissions': {'mean': {'value': 23339.9604, 'units': 'kgCO2e'},\n",
199-
" 'median': {'value': 22586.9408, 'units': 'kgCO2e'},\n",
200-
" 'percentile_20': {'value': 17489.3729, 'units': 'kgCO2e'},\n",
201-
" 'percentile_80': {'value': 28791.3938, 'units': 'kgCO2e'}},\n",
202-
" 'cost': {'mean': {'value': 7583.0636, 'units': '$'},\n",
203-
" 'median': {'value': 7338.4104, 'units': '$'},\n",
204-
" 'percentile_20': {'value': 5682.2301, 'units': '$'},\n",
205-
" 'percentile_80': {'value': 9354.2134, 'units': '$'}}}"
196+
"{'energy': {'mean': {'value': 1639.9717, 'unit': 'gallon'},\n",
197+
" 'median': {'value': 1592.8951, 'unit': 'gallon'},\n",
198+
" 'percentile_20': {'value': 1217.5114, 'unit': 'gallon'},\n",
199+
" 'percentile_80': {'value': 2014.3037, 'unit': 'gallon'}},\n",
200+
" 'emissions': {'mean': {'value': 20183.0257, 'unit': 'kgCO2e'},\n",
201+
" 'median': {'value': 19603.6575, 'unit': 'kgCO2e'},\n",
202+
" 'percentile_20': {'value': 14983.8342, 'unit': 'kgCO2e'},\n",
203+
" 'percentile_80': {'value': 24789.9057, 'unit': 'kgCO2e'}},\n",
204+
" 'cost': {'mean': {'value': 6557.3876, 'unit': '$'},\n",
205+
" 'median': {'value': 6369.1531, 'unit': '$'},\n",
206+
" 'percentile_20': {'value': 4868.1902, 'unit': '$'},\n",
207+
" 'percentile_80': {'value': 8054.1452, 'unit': '$'}}}"
206208
]
207209
},
208210
"execution_count": 9,
@@ -211,7 +213,7 @@
211213
}
212214
],
213215
"source": [
214-
"fuel_results['fuel_oil']['baseline']"
216+
"fuel_results[\"fuel_oil\"][\"baseline\"]"
215217
]
216218
},
217219
{
@@ -223,10 +225,10 @@
223225
{
224226
"data": {
225227
"text/plain": [
226-
"{'electricity': {'value': 0.1241, 'units': 'kgCO2e/kWh'},\n",
227-
" 'natural_gas': {'value': 6.6798, 'units': 'kgCO2e/therm'},\n",
228-
" 'fuel_oil': {'value': 12.3069, 'units': 'kgCO2e/gallon'},\n",
229-
" 'propane': {'value': 7.3776, 'units': 'kgCO2e/gallon'}}"
228+
"{'electricity': {'value': 0.1241, 'unit': 'kgCO2e/kWh'},\n",
229+
" 'natural_gas': {'value': 6.6798, 'unit': 'kgCO2e/therm'},\n",
230+
" 'fuel_oil': {'value': 12.3069, 'unit': 'kgCO2e/gallon'},\n",
231+
" 'propane': {'value': 7.3776, 'unit': 'kgCO2e/gallon'}}"
230232
]
231233
},
232234
"execution_count": 10,
@@ -235,7 +237,7 @@
235237
}
236238
],
237239
"source": [
238-
"data['emissions_factors']"
240+
"data[\"emissions_factors\"]"
239241
]
240242
},
241243
{
@@ -245,8 +247,8 @@
245247
"source": [
246248
"## Let's look at fuel oil, since that's what we are replacing\n",
247249
"\n",
248-
"It's a fairly big block of nested dictionaries, but we will go through it peice by\n",
249-
"peice."
250+
"It's a fairly big block of nested dictionaries, but we will go through it piece by\n",
251+
"piece."
250252
]
251253
},
252254
{
@@ -268,42 +270,42 @@
268270
{
269271
"data": {
270272
"text/plain": [
271-
"{'baseline': {'energy': {'mean': {'value': 1896.4884, 'units': 'gallon'},\n",
272-
" 'median': {'value': 1835.3018, 'units': 'gallon'},\n",
273-
" 'percentile_20': {'value': 1421.099, 'units': 'gallon'},\n",
274-
" 'percentile_80': {'value': 2339.4446, 'units': 'gallon'}},\n",
275-
" 'emissions': {'mean': {'value': 23339.9604, 'units': 'kgCO2e'},\n",
276-
" 'median': {'value': 22586.9408, 'units': 'kgCO2e'},\n",
277-
" 'percentile_20': {'value': 17489.3729, 'units': 'kgCO2e'},\n",
278-
" 'percentile_80': {'value': 28791.3938, 'units': 'kgCO2e'}},\n",
279-
" 'cost': {'mean': {'value': 7583.0636, 'units': '$'},\n",
280-
" 'median': {'value': 7338.4104, 'units': '$'},\n",
281-
" 'percentile_20': {'value': 5682.2301, 'units': '$'},\n",
282-
" 'percentile_80': {'value': 9354.2134, 'units': '$'}}},\n",
283-
" 'upgrade': {'energy': {'mean': {'value': 66.8291, 'units': 'gallon'},\n",
284-
" 'median': {'value': 0.0, 'units': 'gallon'},\n",
285-
" 'percentile_20': {'value': 0.0, 'units': 'gallon'},\n",
286-
" 'percentile_80': {'value': 127.0023, 'units': 'gallon'}},\n",
287-
" 'emissions': {'mean': {'value': 822.4611, 'units': 'kgCO2e'},\n",
288-
" 'median': {'value': 0.0, 'units': 'kgCO2e'},\n",
289-
" 'percentile_20': {'value': 0.0, 'units': 'kgCO2e'},\n",
290-
" 'percentile_80': {'value': 1563.0089, 'units': 'kgCO2e'}},\n",
291-
" 'cost': {'mean': {'value': 267.2145, 'units': '$'},\n",
292-
" 'median': {'value': 0.0, 'units': '$'},\n",
293-
" 'percentile_20': {'value': 0.0, 'units': '$'},\n",
294-
" 'percentile_80': {'value': 507.8156, 'units': '$'}}},\n",
295-
" 'delta': {'energy': {'mean': {'value': -1829.6594, 'units': 'gallon'},\n",
296-
" 'median': {'value': -1734.66, 'units': 'gallon'},\n",
297-
" 'percentile_20': {'value': -2254.9817, 'units': 'gallon'},\n",
298-
" 'percentile_80': {'value': -1351.139, 'units': 'gallon'}},\n",
299-
" 'emissions': {'mean': {'value': -22517.4993, 'units': 'kgCO2e'},\n",
300-
" 'median': {'value': -21348.3478, 'units': 'kgCO2e'},\n",
301-
" 'percentile_20': {'value': -27751.9135, 'units': 'kgCO2e'},\n",
302-
" 'percentile_80': {'value': -16628.3804, 'units': 'kgCO2e'}},\n",
303-
" 'cost': {'mean': {'value': -7315.8491, 'units': '$'},\n",
304-
" 'median': {'value': -6935.9963, 'units': '$'},\n",
305-
" 'percentile_20': {'value': -9016.4902, 'units': '$'},\n",
306-
" 'percentile_80': {'value': -5402.497, 'units': '$'}}}}"
273+
"{'baseline': {'energy': {'mean': {'value': 1639.9717, 'unit': 'gallon'},\n",
274+
" 'median': {'value': 1592.8951, 'unit': 'gallon'},\n",
275+
" 'percentile_20': {'value': 1217.5114, 'unit': 'gallon'},\n",
276+
" 'percentile_80': {'value': 2014.3037, 'unit': 'gallon'}},\n",
277+
" 'emissions': {'mean': {'value': 20183.0257, 'unit': 'kgCO2e'},\n",
278+
" 'median': {'value': 19603.6575, 'unit': 'kgCO2e'},\n",
279+
" 'percentile_20': {'value': 14983.8342, 'unit': 'kgCO2e'},\n",
280+
" 'percentile_80': {'value': 24789.9057, 'unit': 'kgCO2e'}},\n",
281+
" 'cost': {'mean': {'value': 6557.3876, 'unit': '$'},\n",
282+
" 'median': {'value': 6369.1531, 'unit': '$'},\n",
283+
" 'percentile_20': {'value': 4868.1902, 'unit': '$'},\n",
284+
" 'percentile_80': {'value': 8054.1452, 'unit': '$'}}},\n",
285+
" 'upgrade': {'energy': {'mean': {'value': 73.1678, 'unit': 'gallon'},\n",
286+
" 'median': {'value': 0.0, 'unit': 'gallon'},\n",
287+
" 'percentile_20': {'value': 0.0, 'unit': 'gallon'},\n",
288+
" 'percentile_80': {'value': 161.4628, 'unit': 'gallon'}},\n",
289+
" 'emissions': {'mean': {'value': 900.471, 'unit': 'kgCO2e'},\n",
290+
" 'median': {'value': 0.0, 'unit': 'kgCO2e'},\n",
291+
" 'percentile_20': {'value': 0.0, 'unit': 'kgCO2e'},\n",
292+
" 'percentile_80': {'value': 1987.1118, 'unit': 'kgCO2e'}},\n",
293+
" 'cost': {'mean': {'value': 292.5596, 'unit': '$'},\n",
294+
" 'median': {'value': 0.0, 'unit': '$'},\n",
295+
" 'percentile_20': {'value': 0.0, 'unit': '$'},\n",
296+
" 'percentile_80': {'value': 645.605, 'unit': '$'}}},\n",
297+
" 'delta': {'energy': {'mean': {'value': -1566.8039, 'unit': 'gallon'},\n",
298+
" 'median': {'value': -1521.6893, 'unit': 'gallon'},\n",
299+
" 'percentile_20': {'value': -1945.3572, 'unit': 'gallon'},\n",
300+
" 'percentile_80': {'value': -1122.8551, 'unit': 'gallon'}},\n",
301+
" 'emissions': {'mean': {'value': -19282.5547, 'unit': 'kgCO2e'},\n",
302+
" 'median': {'value': -18727.3322, 'unit': 'kgCO2e'},\n",
303+
" 'percentile_20': {'value': -23941.3851, 'unit': 'kgCO2e'},\n",
304+
" 'percentile_80': {'value': -13818.9057, 'unit': 'kgCO2e'}},\n",
305+
" 'cost': {'mean': {'value': -6264.828, 'unit': '$'},\n",
306+
" 'median': {'value': -6084.4384, 'unit': '$'},\n",
307+
" 'percentile_20': {'value': -7778.4641, 'unit': '$'},\n",
308+
" 'percentile_80': {'value': -4489.7094, 'unit': '$'}}}}"
307309
]
308310
},
309311
"execution_count": 12,
@@ -366,10 +368,7 @@
366368
"source": [
367369
"def results_for_stat(results, metric, stat: str):\n",
368370
" \"\"\"A helper function to pull out subsets of the results.\"\"\"\n",
369-
" return {\n",
370-
" k: results[k][metric][stat]\n",
371-
" for k in result_keys\n",
372-
" }"
371+
" return {k: results[k][metric][stat] for k in result_keys}"
373372
]
374373
},
375374
{
@@ -392,9 +391,9 @@
392391
{
393392
"data": {
394393
"text/plain": [
395-
"{'baseline': {'value': 1896.4884, 'units': 'gallon'},\n",
396-
" 'upgrade': {'value': 66.8291, 'units': 'gallon'},\n",
397-
" 'delta': {'value': -1829.6594, 'units': 'gallon'}}"
394+
"{'baseline': {'value': 1639.9717, 'unit': 'gallon'},\n",
395+
" 'upgrade': {'value': 73.1678, 'unit': 'gallon'},\n",
396+
" 'delta': {'value': -1566.8039, 'unit': 'gallon'}}"
398397
]
399398
},
400399
"execution_count": 15,
@@ -444,7 +443,11 @@
444443
}
445444
],
446445
"source": [
447-
"round(mean_energy['upgrade']['value'] - (mean_energy['baseline']['value'] + mean_energy['delta']['value']), 2)"
446+
"round(\n",
447+
" mean_energy[\"upgrade\"][\"value\"]\n",
448+
" - (mean_energy[\"baseline\"][\"value\"] + mean_energy[\"delta\"][\"value\"]),\n",
449+
" 2,\n",
450+
")"
448451
]
449452
},
450453
{
@@ -466,9 +469,9 @@
466469
{
467470
"data": {
468471
"text/plain": [
469-
"{'baseline': {'value': 1835.3018, 'units': 'gallon'},\n",
470-
" 'upgrade': {'value': 0.0, 'units': 'gallon'},\n",
471-
" 'delta': {'value': -1734.66, 'units': 'gallon'}}"
472+
"{'baseline': {'value': 1592.8951, 'unit': 'gallon'},\n",
473+
" 'upgrade': {'value': 0.0, 'unit': 'gallon'},\n",
474+
" 'delta': {'value': -1521.6893, 'unit': 'gallon'}}"
472475
]
473476
},
474477
"execution_count": 17,
@@ -502,7 +505,7 @@
502505
{
503506
"data": {
504507
"text/plain": [
505-
"{'value': 0.0, 'units': 'gallon'}"
508+
"{'value': 0.0, 'unit': 'gallon'}"
506509
]
507510
},
508511
"execution_count": 18,
@@ -523,7 +526,7 @@
523526
{
524527
"data": {
525528
"text/plain": [
526-
"{'value': 127.0023, 'units': 'gallon'}"
529+
"{'value': 161.4628, 'unit': 'gallon'}"
527530
]
528531
},
529532
"execution_count": 19,
@@ -574,9 +577,9 @@
574577
{
575578
"data": {
576579
"text/plain": [
577-
"{'baseline': {'value': 24494.8882, 'units': 'kgCO2e'},\n",
578-
" 'upgrade': {'value': 4827.1306, 'units': 'kgCO2e'},\n",
579-
" 'delta': {'value': -19006.6082, 'units': 'kgCO2e'}}"
580+
"{'baseline': {'value': 21423.6426, 'unit': 'kgCO2e'},\n",
581+
" 'upgrade': {'value': 4743.954, 'unit': 'kgCO2e'},\n",
582+
" 'delta': {'value': -16628.4887, 'unit': 'kgCO2e'}}"
580583
]
581584
},
582585
"execution_count": 22,
@@ -608,7 +611,7 @@
608611
{
609612
"data": {
610613
"text/plain": [
611-
"-661.15"
614+
"-51.2"
612615
]
613616
},
614617
"execution_count": 23,
@@ -617,7 +620,11 @@
617620
}
618621
],
619622
"source": [
620-
"round(median_emissions['upgrade']['value'] - (median_emissions['baseline']['value'] + median_emissions['delta']['value']), 2)"
623+
"round(\n",
624+
" median_emissions[\"upgrade\"][\"value\"]\n",
625+
" - (median_emissions[\"baseline\"][\"value\"] + median_emissions[\"delta\"][\"value\"]),\n",
626+
" 2,\n",
627+
")"
621628
]
622629
},
623630
{
@@ -643,7 +650,7 @@
643650
],
644651
"metadata": {
645652
"kernelspec": {
646-
"display_name": ".venv",
653+
"display_name": "Python 3 (ipykernel)",
647654
"language": "python",
648655
"name": "python3"
649656
},

‎notebooks/REM Demo.ipynb

+111-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"outputs": [],
2323
"source": [
2424
"import requests\n",
25-
"from pathlib import Path"
25+
"from pathlib import Path\n",
26+
"import pandas as pd"
2627
]
2728
},
2829
{
@@ -70,9 +71,9 @@
7071
"metadata": {},
7172
"outputs": [],
7273
"source": [
73-
"address = '8009 Belmont Ave., Lubbock, TX 79424'\n",
74-
"upgrade = \"high_eff_hp_elec_backup\"\n",
75-
"heating_fuel = 'natural_gas'"
74+
"address = \"8009 Belmont Ave., Lubbock, TX 79424\"\n",
75+
"upgrade = \"hvac__heat_pump_seer24_hspf13\"\n",
76+
"heating_fuel = \"natural_gas\""
7677
]
7778
},
7879
{
@@ -95,9 +96,7 @@
9596
"response = requests.get(\n",
9697
" url=REM_ADDRESS_URL,\n",
9798
" headers=headers,\n",
98-
" params=dict(\n",
99-
" address=address, upgrade=upgrade, heating_fuel=heating_fuel\n",
100-
" )\n",
99+
" params=dict(address=address, upgrade=upgrade, heating_fuel=heating_fuel),\n",
101100
")"
102101
]
103102
},
@@ -125,12 +124,14 @@
125124
"cell_type": "code",
126125
"execution_count": 7,
127126
"id": "6aab1b8e-c3d9-4d0f-a7d4-1a86f1543def",
128-
"metadata": {},
127+
"metadata": {
128+
"scrolled": true
129+
},
129130
"outputs": [
130131
{
131132
"data": {
132133
"text/plain": [
133-
"'Expected annual savings: $630.39'"
134+
"'Expected annual savings: $659.07'"
134135
]
135136
},
136137
"execution_count": 7,
@@ -139,23 +140,122 @@
139140
}
140141
],
141142
"source": [
142-
"annual_savings = -data['fuel_results']['total']['delta']['cost']['mean']['value']\n",
143+
"annual_savings = -data[\"fuel_results\"][\"total\"][\"delta\"][\"cost\"][\"mean\"][\"value\"]\n",
143144
"\n",
144145
"f\"Expected annual savings: ${annual_savings:.2f}\""
145146
]
146147
},
148+
{
149+
"cell_type": "markdown",
150+
"id": "5f962705",
151+
"metadata": {},
152+
"source": [
153+
"## Modeling Only Baseline in REM\n",
154+
"\n",
155+
"REM typically provides three estimates for a home: one without an upgrade, one with the requested upgrade, and the difference (delta) between them.\n",
156+
"For a detailed explanation of these statistics, refer to the [All About REM Statistics notebook](https://github.com/rewiringamerica/api_demos/blob/main/notebooks/All%20About%20REM%20Statistics.ipynb).\n",
157+
"\n",
158+
"A special case occurs when `baseline` is requested as the upgrade. In this case, REM returns a subset of the expected data structure.\n",
159+
"For each `fuel_type` within `fuel_results`, the `upgrade` and `delta` fields will not be populated. \n",
160+
"Requesting `baseline` tells REM to perform estimation without applying any upgrades.\n",
161+
"\n",
162+
"Performing a request with only `baseline` can be done similarly to other requests."
163+
]
164+
},
147165
{
148166
"cell_type": "code",
149167
"execution_count": null,
150168
"id": "d697ac84",
151169
"metadata": {},
152170
"outputs": [],
171+
"source": [
172+
"headers = {\"Authorization\": f\"Bearer {API_KEY}\"}\n",
173+
"\n",
174+
"response = requests.get(\n",
175+
" url=REM_ADDRESS_URL,\n",
176+
" headers=headers,\n",
177+
" params=dict(address=address, upgrade=\"baseline\", heating_fuel=heating_fuel),\n",
178+
")"
179+
]
180+
},
181+
{
182+
"cell_type": "markdown",
183+
"id": "31758a83",
184+
"metadata": {},
185+
"source": [
186+
"### Pull out the results for a baseline request\n",
187+
"\n",
188+
"We will extract the `fuel_results`, as we have done previously. In the response, `baseline` contains valid values, while `upgrade` and `delta` are null, as expected since no upgrade was applied to the home."
189+
]
190+
},
191+
{
192+
"cell_type": "code",
193+
"execution_count": null,
194+
"id": "1831a4bd",
195+
"metadata": {},
196+
"outputs": [],
197+
"source": [
198+
"data = response.json()\n",
199+
"fuel_results = data[\"fuel_results\"]"
200+
]
201+
},
202+
{
203+
"cell_type": "code",
204+
"execution_count": null,
205+
"id": "cf88eec5",
206+
"metadata": {},
207+
"outputs": [],
208+
"source": [
209+
"# Convert the baseline from JSON to a pandas data frame for further\n",
210+
"# analysis.\n",
211+
"baseline = fuel_results[heating_fuel][\"baseline\"]\n",
212+
"\n",
213+
"\n",
214+
"def stats_df(baseline):\n",
215+
" return pd.DataFrame(\n",
216+
" [\n",
217+
" {\"metric\": metric, \"stat\": stat} | value\n",
218+
" for metric, stats in baseline.items()\n",
219+
" for stat, value in stats.items()\n",
220+
" ]\n",
221+
" )\n",
222+
"\n",
223+
"\n",
224+
"stats_df(baseline)"
225+
]
226+
},
227+
{
228+
"cell_type": "code",
229+
"execution_count": null,
230+
"id": "5e302eba",
231+
"metadata": {},
232+
"outputs": [],
233+
"source": [
234+
"fuel_results[heating_fuel][\"upgrade\"]"
235+
]
236+
},
237+
{
238+
"cell_type": "code",
239+
"execution_count": null,
240+
"id": "f32a8ed4",
241+
"metadata": {},
242+
"outputs": [],
243+
"source": [
244+
"fuel_results[heating_fuel][\"delta\"]"
245+
]
246+
},
247+
{
248+
"cell_type": "code",
249+
"execution_count": null,
250+
"id": "e39346ac-4825-4f21-a1e8-74c004629005",
251+
"metadata": {},
252+
"outputs": [],
153253
"source": []
154254
}
155255
],
156256
"metadata": {
157257
"kernelspec": {
158-
"display_name": ".venv",
258+
"display_name": "Python 3 (ipykernel)",
159259
"language": "python",
160260
"name": "python3"
161261
},

‎react/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,14 @@ The only difference is that this version is written in react.
1111
If you are not already familiar with react, we suggest you have a look
1212
at the [Tic-Tac-Toe Tutorial](https://react.dev/learn/tutorial-tic-tac-toe),
1313
which is a great interactive introduction to react.
14+
15+
16+
To use, install [Node.js](https://nodejs.org/en/) and run
17+
```
18+
npm install
19+
```
20+
21+
Then run the app with
22+
```
23+
npm start
24+
```

‎react/src/App.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function AddressForm() {
1818
const [savings, setSavings] = useState("")
1919
const [hidden, setHidden] = useState(true)
2020

21-
const upgrade = 'high_eff_hp_elec_backup'
21+
const upgrade = 'hvac__heat_pump_seer24_hspf13'
2222

2323
// This is the URL for the REM API.
2424
const remApiURL = "https://api.rewiringamerica.org/api/v1/rem/address"
@@ -174,4 +174,4 @@ export default function App() {
174174
</div>
175175
</>
176176
);
177-
}
177+
}

‎rem-with-nextjs/app/serverSavings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const RA_API_KEY = await accessRaApiKey()
3030

3131
export default async function serverSavings(address : string, currentFuel: string) {
3232

33-
const upgrade = 'high_eff_hp_elec_backup';
33+
const upgrade = 'hvac__heat_pump_seer24_hspf13';
3434

3535
// This is the URL for the REM API.
3636
const remApiURL = "https://api.rewiringamerica.org/api/v1/rem/address";

‎www/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const address = document.getElementById("address").value;
3737
const fuel = document.querySelector('input[name="fuel"]:checked').value;
3838
const base_url = "https://api.rewiringamerica.org/api/v1/rem/address"
39-
const url = encodeURI(base_url + "?upgrade=high_eff_hp_elec_backup&address=" + address + "&heating_fuel=" + fuel)
39+
const url = encodeURI(base_url + "?upgrade=hvac__heat_pump_seer24_hspf13&address=" + address + "&heating_fuel=" + fuel)
4040
const options = {method: 'GET', accept: "application/json", headers: {Authorization: "Bearer " + api_key}};
4141

4242
console.log("Fetching " + url)

0 commit comments

Comments
 (0)
Please sign in to comment.