Skip to content

Commit

Permalink
refactor ASHP to Pascal Case
Browse files Browse the repository at this point in the history
  • Loading branch information
zolanaj committed Aug 29, 2024
1 parent 155141a commit 72cb3e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions reoptjl/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8167,10 +8167,10 @@ def filter_none_and_empty_array(d:dict):
try: d["ElectricHeater"] = filter_none_and_empty_array(meta.ElectricHeaterInputs.dict)
except: pass

try: d["ASHP_SpaceHeater"] = filter_none_and_empty_array(meta.ASHPSpaceHeaterInputs.dict)
try: d["ASHPSpaceHeater"] = filter_none_and_empty_array(meta.ASHPSpaceHeaterInputs.dict)
except: pass

try: d["ASHP_WaterHeater"] = filter_none_and_empty_array(meta.ASHPWaterHeaterInputs.dict)
try: d["ASHPWaterHeater"] = filter_none_and_empty_array(meta.ASHPWaterHeaterInputs.dict)
except: pass

return d
Expand Down
4 changes: 2 additions & 2 deletions reoptjl/test/posts/all_inputs_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
"can_serve_space_heating": true,
"can_serve_process_heat": true
},
"ASHP_SpaceHeater": {
"ASHPSpaceHeater": {
"min_ton": 100.0,
"max_ton": 100.0,
"installed_cost_per_ton": 2250.0,
Expand All @@ -353,7 +353,7 @@
"can_serve_cooling": true,
"force_into_system": false
},
"ASHP_WaterHeater": {
"ASHPWaterHeater": {
"min_ton": 100.0,
"max_ton": 100.0,
"installed_cost_per_ton": 2250.0,
Expand Down
20 changes: 10 additions & 10 deletions reoptjl/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def help(request):
d["SteamTurbine"] = SteamTurbineInputs.info_dict(SteamTurbineInputs)
d["GHP"] = GHPInputs.info_dict(GHPInputs)
d["ElectricHeater"] = ElectricHeaterInputs.info_dict(ElectricHeaterInputs)
d["ASHP_SpaceHeater"] = ASHPSpaceHeaterInputs.info_dict(ASHPSpaceHeaterInputs)
d["ASHP_WaterHeater"] = ASHPWaterHeaterInputs.info_dict(ASHPWaterHeaterInputs)
d["ASHPSpaceHeater"] = ASHPSpaceHeaterInputs.info_dict(ASHPSpaceHeaterInputs)
d["ASHPWaterHeater"] = ASHPWaterHeaterInputs.info_dict(ASHPWaterHeaterInputs)

return JsonResponse(d)

Expand Down Expand Up @@ -110,8 +110,8 @@ def outputs(request):
d["AbsorptionChiller"] = AbsorptionChillerOutputs.info_dict(AbsorptionChillerOutputs)
d["GHP"] = GHPOutputs.info_dict(GHPOutputs)
d["ElectricHeater"] = ElectricHeaterOutputs.info_dict(ElectricHeaterOutputs)
d["ASHP_SpaceHeater"] = ASHPSpaceHeaterOutputs.info_dict(ASHPSpaceHeaterOutputs)
d["ASHP_WaterHeater"] = ASHPWaterHeaterOutputs.info_dict(ASHPWaterHeaterOutputs)
d["ASHPSpaceHeater"] = ASHPSpaceHeaterOutputs.info_dict(ASHPSpaceHeaterOutputs)
d["ASHPWaterHeater"] = ASHPWaterHeaterOutputs.info_dict(ASHPWaterHeaterOutputs)
d["Messages"] = REoptjlMessageOutputs.info_dict(REoptjlMessageOutputs)
d["SteamTurbine"] = SteamTurbineOutputs.info_dict(SteamTurbineOutputs)
return JsonResponse(d)
Expand Down Expand Up @@ -241,10 +241,10 @@ def results(request, run_uuid):
try: r["inputs"]["ElectricHeater"] = meta.ElectricHeaterInputs.dict
except: pass

try: r["inputs"]["ASHP_SpaceHeater"] = meta.ASHPSpaceHeaterInputs.dict
try: r["inputs"]["ASHPSpaceHeater"] = meta.ASHPSpaceHeaterInputs.dict
except: pass

try: r["inputs"]["ASHP_WaterHeater"] = meta.ASHPWaterHeaterInputs.dict
try: r["inputs"]["ASHPWaterHeater"] = meta.ASHPWaterHeaterInputs.dict
except: pass

try:
Expand Down Expand Up @@ -321,9 +321,9 @@ def results(request, run_uuid):
except: pass
try: r["outputs"]["ElectricHeater"] = meta.ElectricHeaterOutputs.dict
except: pass
try: r["outputs"]["ASHP_SpaceHeater"] = meta.ASHPSpaceHeaterOutputs.dict
try: r["outputs"]["ASHPSpaceHeater"] = meta.ASHPSpaceHeaterOutputs.dict
except: pass
try: r["outputs"]["ASHP_WaterHeater"] = meta.ASHPWaterHeaterOutputs.dict
try: r["outputs"]["ASHPWaterHeater"] = meta.ASHPWaterHeaterOutputs.dict
except: pass

for d in r["outputs"].values():
Expand Down Expand Up @@ -1062,15 +1062,15 @@ def queryset_for_summary(api_metas,summary_dict:dict):
)
if len(ashpSpaceHeater) > 0:
for m in ashpSpaceHeater:
summary_dict[str(m.meta.run_uuid)]['ashp_space_heater_ton'] = m.size_ton
summary_dict[str(m.meta.run_uuid)]['ASHPSpace_heater_ton'] = m.size_ton

ashpWaterHeater = ASHPWaterHeaterOutputs.objects.filter(meta__run_uuid__in=run_uuids).only(
'meta__run_uuid',
'size_ton'
)
if len(ashpSpaceHeater) > 0:
for m in ashpSpaceHeater:
summary_dict[str(m.meta.run_uuid)]['ashp_water_heater_ton'] = m.size_ton
summary_dict[str(m.meta.run_uuid)]['ASHPWater_heater_ton'] = m.size_ton

return summary_dict

Expand Down

0 comments on commit 72cb3e9

Please sign in to comment.