Skip to content

Commit a0ad437

Browse files
committed
update __repr__ in PVSystem and LocalizedPVSystem and add self.location in LocalizedPVSystem
1 parent 01fa4aa commit a0ad437

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

pvlib/pvsystem.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ def __init__(self,
141141
super(PVSystem, self).__init__(**kwargs)
142142

143143
def __repr__(self):
144-
return 'PVSystem with tilt:' + str(self.surface_tilt) + ' and azimuth: ' + str(self.surface_azimuth)
144+
return ('PVSystem with tilt:' + str(self.surface_tilt) +
145+
' and azimuth: ' + str(self.surface_azimuth) +
146+
' with Module: ' + str(self.module) +
147+
' and Inverter: ' + str(self.inverter))
145148

146149
def get_aoi(self, solar_zenith, solar_azimuth):
147150
"""Get the angle of incidence on the system.
@@ -439,7 +442,9 @@ def __init__(self, pvsystem=None, location=None, **kwargs):
439442

440443
# get and combine attributes from the pvsystem and/or location
441444
# with the rest of the kwargs
442-
445+
446+
self.location = location
447+
443448
if pvsystem is not None:
444449
pv_dict = pvsystem.__dict__
445450
else:
@@ -457,7 +462,11 @@ def __init__(self, pvsystem=None, location=None, **kwargs):
457462
super(LocalizedPVSystem, self).__init__(**new_kwargs)
458463

459464
def __repr__(self):
460-
return 'LocalizedPVSystem'
465+
return ('LocalizedPVSystem with tilt:' + str(self.surface_tilt) +
466+
' and azimuth: ' + str(self.surface_azimuth) +
467+
' with Module: ' + str(self.module) +
468+
' and Inverter: ' + str(self.inverter) +
469+
' and Location: ' + str(self.location))
461470

462471

463472
def systemdef(meta, surface_tilt, surface_azimuth, albedo, series_modules,

0 commit comments

Comments
 (0)