-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Error results when passing in 'pv_nameplate' input into SystemAnalysis object.
minimum example:
sa = rdtools.SystemAnalysis(df['power_E'], df['poa'],
cell_temperature=df['Tcell'],
pvlib_location=loc,
pv_tilt=meta['tilt'],
pv_azimuth=meta['azimuth'],
pv_nameplate = meta['pdc']
)#
Error:
UnboundLocalError Traceback (most recent call last)
in ()
----> 1 sa_E.sensor_analysis(analyses=['yoy_degradation'])
c:\users\cdeline\documents\python scripts\kwh_rdtools\rdtools\system_analysis.py in sensor_analysis(self, analyses, yoy_kwargs, srr_kwargs)
479 '''
480
--> 481 self.sensor_preprocess()
482 sensor_results = {}
483
c:\users\cdeline\documents\python scripts\kwh_rdtools\rdtools\system_analysis.py in sensor_preprocess(self)
438 if self.cell_temperature is None:
439 self.cell_temperature = self.calc_cell_temperature(self.poa, self.windspeed, self.ambient_temperature)
--> 440 normalized, insolation = self.pvwatts_norm(self.poa, self.cell_temperature)
441 self.filter(normalized, 'sensor')
442 aggregated, aggregated_insolation = self.aggregate(normalized[self.sensor_filter], insolation[self.sensor_filter])
c:\users\cdeline\documents\python scripts\kwh_rdtools\rdtools\system_analysis.py in pvwatts_norm(self, poa, cell_temperature)
257
258 pvwatts_kws = {"poa_global": poa,
--> 259 "P_ref": pv_nameplate,
260 "T_cell": cell_temperature,
261 "G_ref": 1000,
UnboundLocalError: local variable 'pv_nameplate' referenced before assignment
Solution: has to do with pv_nameplate and self.pv_nameplate naming error. Will submit pull request momentarily.