Skip to content

Commit 6aa1597

Browse files
committed
remove unnecassary location override and adjust __repr__ statement in Tracking
1 parent 91ccfd4 commit 6aa1597

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pvlib/test/test_tracking.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,5 +303,7 @@ def test_LocalizedSingleAxisTracker___repr__():
303303

304304

305305
assert localized_system.__repr__() == ('LocalizedSingleAxisTracker with '+
306-
'max_angle: 90 at Location: None')
306+
'max_angle: 90 at Location: None: '+
307+
'latitude=32, longitude=-111, ' +
308+
'tz=UTC, altitude=0')
307309

pvlib/tracking.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ def __init__(self, pvsystem=None, location=None, **kwargs):
148148
# get and combine attributes from the pvsystem and/or location
149149
# with the rest of the kwargs
150150

151-
self.location = location
152-
153151
if pvsystem is not None:
154152
pv_dict = pvsystem.__dict__
155153
else:
@@ -170,7 +168,10 @@ def __init__(self, pvsystem=None, location=None, **kwargs):
170168
def __repr__(self):
171169
return ('Localized' +
172170
super(LocalizedSingleAxisTracker, self).__repr__()
173-
+ ' at Location: ' + str(self.location))
171+
+ ' at Location: ' +
172+
('{}: latitude={}, longitude={}, tz={}, altitude={}'
173+
.format(self.name, self.latitude, self.longitude,
174+
self.tz, self.altitude)))
174175

175176

176177
def singleaxis(apparent_zenith, apparent_azimuth,

0 commit comments

Comments
 (0)