Skip to content

Commit c2da263

Browse files
committed
add __repr__ for SingleAxisTracker and LocalizedSingleAxisTracker and self.location
1 parent a0ad437 commit c2da263

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pvlib/tracking.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ def __init__(self, axis_tilt=0, axis_azimuth=0,
2929
self.gcr = gcr
3030

3131
super(SingleAxisTracker, self).__init__(**kwargs)
32-
32+
33+
34+
def __repr__(self):
35+
return ('SingleAxisTracker with max_angle: ' +
36+
str(self.max_angle))
37+
3338

3439
def singleaxis(self, apparent_zenith, apparent_azimuth):
3540
tracking_data = singleaxis(apparent_zenith, apparent_azimuth,
@@ -143,6 +148,8 @@ def __init__(self, pvsystem=None, location=None, **kwargs):
143148
# get and combine attributes from the pvsystem and/or location
144149
# with the rest of the kwargs
145150

151+
self.location = location
152+
146153
if pvsystem is not None:
147154
pv_dict = pvsystem.__dict__
148155
else:
@@ -158,6 +165,12 @@ def __init__(self, pvsystem=None, location=None, **kwargs):
158165
list(kwargs.items()))
159166

160167
super(LocalizedSingleAxisTracker, self).__init__(**new_kwargs)
168+
169+
170+
def __repr__(self):
171+
return ('Localized' +
172+
super(LocalizedSingleAxisTracker, self).__repr__()
173+
+ ' at Location: ' + str(self.location))
161174

162175

163176
def singleaxis(apparent_zenith, apparent_azimuth,

0 commit comments

Comments
 (0)