Skip to content

Commit 38821b0

Browse files
committed
remove unnecassray location import, remove location override
1 parent 9ee46e0 commit 38821b0

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

pvlib/modelchain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
import pandas as pd
1010

11-
from pvlib import solarposition, pvsystem, clearsky, atmosphere, location
11+
from pvlib import solarposition, pvsystem, clearsky, atmosphere
12+
#location
1213
import pvlib.irradiance # avoid name conflict with full import
1314

1415

pvlib/pvsystem.py

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

410-
self.location = location
411-
412410
if pvsystem is not None:
413411
pv_dict = pvsystem.__dict__
414412
else:
@@ -430,7 +428,10 @@ def __repr__(self):
430428
' and azimuth: ' + str(self.surface_azimuth) +
431429
' with Module: ' + str(self.module) +
432430
' and Inverter: ' + str(self.inverter) +
433-
' and Location: ' + str(self.location))
431+
' and Location: ' +
432+
('{}: latitude={}, longitude={}, tz={}, altitude={}'
433+
.format(self.name, self.latitude, self.longitude,
434+
self.tz, self.altitude)))
434435

435436

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

pvlib/test/test_pvsystem.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,5 +493,8 @@ def test_LocalizedPVSystem___repr__():
493493
module='blah',
494494
inverter='blarg')
495495

496-
assert localized_system.__repr__()==('LocalizedPVSystem with tilt:0 and'+
497-
' azimuth: 180 with Module: blah and Inverter: blarg and Location: None')
496+
assert localized_system.__repr__()==('LocalizedPVSystem with tilt:0 and '+
497+
'azimuth: 180 with Module: blah and '+
498+
'Inverter: blarg and Location: None: '+
499+
'latitude=32, longitude=-111, '+
500+
'tz=UTC, altitude=0')

0 commit comments

Comments
 (0)