Skip to content

Commit faeae03

Browse files
raise NotImplementedError for AddOn Electricity/Heat for SAM-EM
1 parent 77cd6ae commit faeae03

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/geophires_x/EconomicsAddOns.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ def read_parameters(self, model: Model) -> None:
222222
model.logger.info(f'Init {str(__class__)}: {sys._getframe().f_code.co_name}')
223223
super().read_parameters(model) # read the parameters for the parent.
224224

225+
is_sam_econ_model = model.economics.econmodel.value == EconomicModel.SAM_SINGLE_OWNER_PPA
226+
225227
# Deal with all the parameter values that the user has provided that relate to this extension.
226228
# super.read_parameter will have already dealt with all the regular values, but anything unusual
227229
# may not be dealt with, so check.
@@ -244,12 +246,21 @@ def read_parameters(self, model: Model) -> None:
244246
if key.startswith("AddOn OPEX"):
245247
val = float(model.InputParameters[key].sValue)
246248
self.AddOnOPEXPerYear.value.append(val) # this assumes they put the values in the file in consecutive fashion
249+
247250
if key.startswith("AddOn Electricity Gained"):
251+
if is_sam_econ_model:
252+
raise NotImplementedError('AddOn Electricity is not supported for SAM Economic Models')
253+
248254
val = float(model.InputParameters[key].sValue)
249255
self.AddOnElecGainedPerYear.value.append(val) # this assumes they put the values in the file in consecutive fashion
256+
250257
if key.startswith("AddOn Heat Gained"):
258+
if is_sam_econ_model:
259+
raise NotImplementedError('AddOn Heat is not supported for SAM Economic Models')
260+
251261
val = float(model.InputParameters[key].sValue)
252262
self.AddOnHeatGainedPerYear.value.append(val) # this assumes they put the values in the file in consecutive fashion
263+
253264
if key.startswith("AddOn Profit Gained"):
254265
val = float(model.InputParameters[key].sValue)
255266
self.AddOnProfitGainedPerYear.value.append(val) # this assumes they put the values in the file in consecutive fashion

0 commit comments

Comments
 (0)