Skip to content

Commit

Permalink
Fix typos. (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
lymereJ authored Oct 10, 2023
1 parent 9bf77cf commit 6d6f1dd
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 31 deletions.
20 changes: 10 additions & 10 deletions copper/chiller.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,38 +717,38 @@ def get_curves_from_lib(self, lib, filters):

# Selecting the relevant filters based on compressor type
if self.compressor_type == "positive_displacement":
tr_wtr_screw = lib.find_set_of_curvess_from_lib(
tr_wtr_screw = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "screw")], part_eff_flag=True
)
tr_wtr_scroll = lib.find_set_of_curvess_from_lib(
tr_wtr_scroll = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "scroll")], part_eff_flag=True
)
tr_wtr_rec = lib.find_set_of_curvess_from_lib(
tr_wtr_rec = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "reciprocating")],
part_eff_flag=True,
)
sets = tr_wtr_screw + tr_wtr_scroll + tr_wtr_rec
elif self.compressor_type == "any":
tr_wtr_screw = lib.find_set_of_curvess_from_lib(
tr_wtr_screw = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "screw")], part_eff_flag=True
)
tr_wtr_scroll = lib.find_set_of_curvess_from_lib(
tr_wtr_scroll = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "scroll")], part_eff_flag=True
)
tr_wtr_rec = lib.find_set_of_curvess_from_lib(
tr_wtr_rec = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "reciprocating")],
part_eff_flag=True,
)
ep_wtr_cent = lib.find_set_of_curvess_from_lib(
ep_wtr_cent = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "centrifugal")],
part_eff_flag=True,
)
sets = tr_wtr_screw + tr_wtr_scroll + tr_wtr_rec + ep_wtr_cent
elif self.compressor_type == "scroll/screw":
tr_wtr_screw = lib.find_set_of_curvess_from_lib(
tr_wtr_screw = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "screw")], part_eff_flag=True
)
tr_wtr_scroll = lib.find_set_of_curvess_from_lib(
tr_wtr_scroll = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "scroll")], part_eff_flag=True
)
sets = tr_wtr_screw + tr_wtr_scroll
Expand All @@ -758,7 +758,7 @@ def get_curves_from_lib(self, lib, filters):
"reciprocating",
"centrifugal",
]:
ep_wtr = lib.find_set_of_curvess_from_lib(
ep_wtr = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", self.compressor_type)],
part_eff_flag=True,
)
Expand Down
9 changes: 6 additions & 3 deletions copper/curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,10 @@ def export(self, path="./", fmt="idf", name=""):
curve_export = ""
for curve in self.curves:
curve_type = curve.type
self.name = self.name.replace("/", "_").replace(" ", "_")
if name != "":
curve_name = self.name.replace("/", "_").replace(" ", "_")
else:
curve_name = name
if fmt == "idf":
if curve_type == "quad":
curve_type = "Curve:Quadratic"
Expand All @@ -520,7 +523,7 @@ def export(self, path="./", fmt="idf", name=""):
if len(curve_export)
else "{},\n".format(curve_type)
)
curve_export += " {}_{},\n".format(self.name, curve.out_var)
curve_export += " {}_{},\n".format(curve_name, curve.out_var)
for i in range(1, curve.nb_coeffs() + 1):
curve_export += " {},\n".format(
getattr(curve, "coeff{}".format(i))
Expand All @@ -544,7 +547,7 @@ def export(self, path="./", fmt="idf", name=""):
curve_export += (
" {};\n".format(curve.out_max) if curve.out_max else " ;\n"
)
filen = open(path + "/" + self.name + ".{}".format(fmt), "w+")
filen = open(path + "/" + curve_name + ".{}".format(fmt), "w+")
filen.write(curve_export)
elif fmt == "csv":
curve_export += f"{self.name},{curve.out_var},{curve.units},{curve.type},{curve.x_min},{curve.x_max},{curve.y_min},{curve.y_max}"
Expand Down
2 changes: 1 addition & 1 deletion copper/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def get_unique_eqp_fields(self):
uni_field_val[field] = set(val)
return uni_field_val

def find_set_of_curvess_from_lib(self, filters=[], part_eff_flag=False):
def find_set_of_curves_from_lib(self, filters=[], part_eff_flag=False):
"""Retrieve sets of curves from a library matching specific filters.
:param list filters: List of filters, represented by tuples (field, val)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Quickstart Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ First, we create the JSON input file.

{
"Quickstart_Guide_Chiller":{
"eqp_type":"chiller",
"eqp_type":"Chiller",
"compressor_type":"screw",
"condenser_type":"water",
"compressor_speed":"constant",
Expand Down
24 changes: 12 additions & 12 deletions docs/source/chiller_lib_summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ ECT,screw,water,constant,38
ECT,screw,water,variable,4
ECT,scroll,air,constant,12
ECT,scroll,water,constant,7
lct_lwt,centrifugal,air,constant,1
lct_lwt,centrifugal,water,constant,95
lct_lwt,centrifugal,water,variable,38
lct_lwt,reciprocating,air,constant,1
lct_lwt,reciprocating,water,constant,3
lct_lwt,reciprocating,water,variable,1
lct_lwt,screw,air,constant,9
lct_lwt,screw,air,variable,11
lct_lwt,screw,water,constant,38
lct_lwt,screw,water,variable,4
lct_lwt,scroll,air,constant,12
lct_lwt,scroll,water,constant,7
LCT,centrifugal,air,constant,1
LCT,centrifugal,water,constant,95
LCT,centrifugal,water,variable,38
LCT,reciprocating,air,constant,1
LCT,reciprocating,water,constant,3
LCT,reciprocating,water,variable,1
LCT,screw,air,constant,9
LCT,screw,air,variable,11
LCT,screw,water,constant,38
LCT,screw,water,variable,4
LCT,scroll,air,constant,12
LCT,scroll,water,constant,7
8 changes: 4 additions & 4 deletions tests/test_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_curves(self):
("source", "2"),
]

set_of_curvess = lib.find_set_of_curvess_from_lib(filters=filters)
set_of_curvess = lib.find_set_of_curves_from_lib(filters=filters)
self.assertTrue(len(set_of_curvess) == 111)

# Plot curves
Expand Down Expand Up @@ -127,10 +127,10 @@ def test_agg(self):

# Run unittest with a centrifugal chiller
lib = cp.Library(path=chiller_lib)
ep_wtr_screw = lib.find_set_of_curvess_from_lib(
ep_wtr_screw = lib.find_set_of_curves_from_lib(
filters=filters + [("source", "2"), ("compressor_type", "screw")]
)
ep_wtr_scroll = lib.find_set_of_curvess_from_lib(
ep_wtr_scroll = lib.find_set_of_curves_from_lib(
filters=filters + [("source", "2"), ("compressor_type", "scroll")]
)
centrifugal_chlr = ep_wtr_screw + ep_wtr_scroll
Expand Down Expand Up @@ -271,7 +271,7 @@ def test_flow_calcs_after_agg(self):
("sim_engine", "energyplus"),
]

sets = lib.find_set_of_curvess_from_lib(
sets = lib.find_set_of_curves_from_lib(
filters=filters + [("compressor_type", "centrifugal")], part_eff_flag=True
)

Expand Down

0 comments on commit 6d6f1dd

Please sign in to comment.