Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9e54af7

Browse filesBrowse files
committed
Merge branch 'master' of https://github.com/pvlib/pvlib-python
2 parents ecf6c6d + 44742c5 commit 9e54af7
Copy full SHA for 9e54af7

File tree

Expand file treeCollapse file tree

6 files changed

+58
-40
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+58
-40
lines changed
Open diff view settings
Collapse file

‎docs/sphinx/source/whatsnew/v0.4.1.txt‎

Copy file name to clipboardExpand all lines: docs/sphinx/source/whatsnew/v0.4.1.txt
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
.. _whatsnew_0410:
22

3-
v0.4.1 (August xx, 2016)
3+
v0.4.1 (October 5, 2016)
44
------------------------
55

66
This is a minor release from 0.4.0. We recommend that all users upgrade
7-
to this version.
7+
to this version, especially if they want to use the latest versions of
8+
pandas.
89

910

1011
Bug fixes
@@ -13,13 +14,16 @@ Bug fixes
1314
* Fixed an error in the irradiance.klucher transposition model.
1415
The error was introduced in version 0.4.0. (:issue:`228`)
1516
* Update RAP forecast model variable names. (:issue:`241`)
17+
* Fix incompatibility with pandas 0.19 and solar position calculations.
18+
(:issue:`246`)
1619

1720

1821
Documentation
1922
~~~~~~~~~~~~~
2023

2124
* Fixed a typo in the pvsystem.sapm returns description. (:issue:`234`)
2225
* Replaced nosetests references with py.test. (:issue:`232`)
26+
* Improve the rendering of the snlinverter doc string. (:issue:`242`)
2327

2428

2529
Code Contributors
Collapse file

‎pvlib/irradiance.py‎

Copy file name to clipboardExpand all lines: pvlib/irradiance.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ def extraradiation(datetime_or_doy, solar_constant=1366.1, method='spencer',
4343
4444
Parameters
4545
----------
46-
datetime_or_doy : int, float, array, date, datetime, datetime64,
47-
Timestamp, DatetimeIndex
46+
datetime_or_doy : numeric, array, date, datetime, Timestamp, DatetimeIndex
4847
Day of year, array of days of year, or datetime-like object
4948
5049
solar_constant : float
Collapse file

‎pvlib/pvsystem.py‎

Copy file name to clipboardExpand all lines: pvlib/pvsystem.py
+33-30Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ def i_from_v(resistance_shunt, resistance_series, nNsVth, voltage,
19221922

19231923

19241924
def snlinverter(v_dc, p_dc, inverter):
1925-
'''
1925+
r'''
19261926
Converts DC power and voltage to AC power using Sandia's
19271927
Grid-Connected PV Inverter model.
19281928
@@ -1950,35 +1950,7 @@ def snlinverter(v_dc, p_dc, inverter):
19501950
Grid-Connected Photovoltaic Inverter Model (SAND 2007-5036) [1].
19511951
A set of inverter performance parameters are provided with
19521952
pvlib, or may be generated from a System Advisor Model (SAM) [2]
1953-
library using retrievesam.
1954-
1955-
Required DataFrame columns are:
1956-
1957-
====== ============================================================
1958-
Column Description
1959-
====== ============================================================
1960-
Pac0 AC-power output from inverter based on input power
1961-
and voltage (W)
1962-
Pdc0 DC-power input to inverter, typically assumed to be equal
1963-
to the PV array maximum power (W)
1964-
Vdc0 DC-voltage level at which the AC-power rating is achieved
1965-
at the reference operating condition (V)
1966-
Ps0 DC-power required to start the inversion process, or
1967-
self-consumption by inverter, strongly influences inverter
1968-
efficiency at low power levels (W)
1969-
C0 Parameter defining the curvature (parabolic) of the
1970-
relationship between ac-power and dc-power at the reference
1971-
operating condition, default value of zero gives a
1972-
linear relationship (1/W)
1973-
C1 Empirical coefficient allowing Pdco to vary linearly
1974-
with dc-voltage input, default value is zero (1/V)
1975-
C2 Empirical coefficient allowing Pso to vary linearly with
1976-
dc-voltage input, default value is zero (1/V)
1977-
C3 Empirical coefficient allowing Co to vary linearly with
1978-
dc-voltage input, default value is zero (1/V)
1979-
Pnt AC-power consumed by inverter at night (night tare) to
1980-
maintain circuitry required to sense PV array voltage (W)
1981-
====== ============================================================
1953+
library using retrievesam. See Notes for required keys.
19821954
19831955
Returns
19841956
-------
@@ -1992,6 +1964,37 @@ def snlinverter(v_dc, p_dc, inverter):
19921964
tracking (MPPT) voltage windows or maximum current limits of the
19931965
inverter.
19941966
1967+
Notes
1968+
-----
1969+
1970+
Required inverter keys are:
1971+
1972+
====== ============================================================
1973+
Column Description
1974+
====== ============================================================
1975+
Pac0 AC-power output from inverter based on input power
1976+
and voltage (W)
1977+
Pdc0 DC-power input to inverter, typically assumed to be equal
1978+
to the PV array maximum power (W)
1979+
Vdc0 DC-voltage level at which the AC-power rating is achieved
1980+
at the reference operating condition (V)
1981+
Ps0 DC-power required to start the inversion process, or
1982+
self-consumption by inverter, strongly influences inverter
1983+
efficiency at low power levels (W)
1984+
C0 Parameter defining the curvature (parabolic) of the
1985+
relationship between ac-power and dc-power at the reference
1986+
operating condition, default value of zero gives a
1987+
linear relationship (1/W)
1988+
C1 Empirical coefficient allowing Pdco to vary linearly
1989+
with dc-voltage input, default value is zero (1/V)
1990+
C2 Empirical coefficient allowing Pso to vary linearly with
1991+
dc-voltage input, default value is zero (1/V)
1992+
C3 Empirical coefficient allowing Co to vary linearly with
1993+
dc-voltage input, default value is zero (1/V)
1994+
Pnt AC-power consumed by inverter at night (night tare) to
1995+
maintain circuitry required to sense PV array voltage (W)
1996+
====== ============================================================
1997+
19951998
References
19961999
----------
19972000
[1] SAND2007-5036, "Performance Model for Grid-Connected
Collapse file

‎pvlib/solarposition.py‎

Copy file name to clipboardExpand all lines: pvlib/solarposition.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def spa_python(time, latitude, longitude,
317317
except (TypeError, ValueError):
318318
time = pd.DatetimeIndex([time, ])
319319

320-
unixtime = time.astype(np.int64)/10**9
320+
unixtime = np.array(time.astype(np.int64)/10**9)
321321

322322
spa = _spa_python_import(how)
323323

@@ -390,7 +390,7 @@ def get_sun_rise_set_transit(time, latitude, longitude, how='numpy',
390390

391391
# must convert to midnight UTC on day of interest
392392
utcday = pd.DatetimeIndex(time.date).tz_localize('UTC')
393-
unixtime = utcday.astype(np.int64)/10**9
393+
unixtime = np.array(utcday.astype(np.int64)/10**9)
394394

395395
spa = _spa_python_import(how)
396396

@@ -813,7 +813,7 @@ def nrel_earthsun_distance(time, how='numpy', delta_t=None, numthreads=4):
813813
except (TypeError, ValueError):
814814
time = pd.DatetimeIndex([time, ])
815815

816-
unixtime = time.astype(np.int64)/10**9
816+
unixtime = np.array(time.astype(np.int64)/10**9)
817817

818818
spa = _spa_python_import(how)
819819

Collapse file

‎pvlib/test/test_spa.py‎

Copy file name to clipboardExpand all lines: pvlib/test/test_spa.py
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929

3030
times = (pd.date_range('2003-10-17 12:30:30', periods=1, freq='D')
3131
.tz_localize('MST'))
32-
unixtimes = times.tz_convert('UTC').astype(np.int64)*1.0/10**9
32+
unixtimes = np.array(times.tz_convert('UTC').astype(np.int64)*1.0/10**9)
33+
3334
lat = 39.742476
3435
lon = -105.1786
3536
elev = 1830.14
@@ -251,6 +252,9 @@ def test_transit_sunrise_sunset(self):
251252
sunset = pd.DatetimeIndex([dt.datetime(1996, 7, 5, 17, 1, 4),
252253
dt.datetime(2004, 12, 4, 19, 2, 2)]
253254
).tz_localize('UTC').astype(np.int64)*1.0/10**9
255+
times = np.array(times)
256+
sunrise = np.array(sunrise)
257+
sunset = np.array(sunset)
254258
result = self.spa.transit_sunrise_sunset(times, -35.0, 0.0, 64.0, 1)
255259
assert_almost_equal(sunrise/1e3, result[1]/1e3, 3)
256260
assert_almost_equal(sunset/1e3, result[2]/1e3, 3)
@@ -262,6 +266,9 @@ def test_transit_sunrise_sunset(self):
262266
).tz_localize('UTC').astype(np.int64)*1.0/10**9
263267
sunrise = pd.DatetimeIndex([dt.datetime(1994, 1, 2, 7, 8, 12),]
264268
).tz_localize('UTC').astype(np.int64)*1.0/10**9
269+
times = np.array(times)
270+
sunrise = np.array(sunrise)
271+
sunset = np.array(sunset)
265272
result = self.spa.transit_sunrise_sunset(times, 35.0, 0.0, 64.0, 1)
266273
assert_almost_equal(sunrise/1e3, result[1]/1e3, 3)
267274
assert_almost_equal(sunset/1e3, result[2]/1e3, 3)
@@ -283,6 +290,9 @@ def test_transit_sunrise_sunset(self):
283290
dt.datetime(2015, 8, 2, 19, 10),
284291
dt.datetime(2015, 12, 2, 16, 38),],
285292
).tz_localize('MST').astype(np.int64)*1.0/10**9
293+
times = np.array(times)
294+
sunrise = np.array(sunrise)
295+
sunset = np.array(sunset)
286296
result = self.spa.transit_sunrise_sunset(times, 39.0, -105.0, 64.0, 1)
287297
assert_almost_equal(sunrise/1e3, result[1]/1e3, 1)
288298
assert_almost_equal(sunset/1e3, result[2]/1e3, 1)
@@ -305,6 +315,9 @@ def test_transit_sunrise_sunset(self):
305315
dt.datetime(2015, 12, 2, 16, 50),],
306316
).tz_localize('Asia/Shanghai'
307317
).astype(np.int64)*1.0/10**9
318+
times = np.array(times)
319+
sunrise = np.array(sunrise)
320+
sunset = np.array(sunset)
308321
result = self.spa.transit_sunrise_sunset(times, 39.917, 116.383, 64.0,1)
309322
assert_almost_equal(sunrise/1e3, result[1]/1e3, 1)
310323
assert_almost_equal(sunset/1e3, result[2]/1e3, 1)
@@ -313,6 +326,7 @@ def test_earthsun_distance(self):
313326
times = (pd.date_range('2003-10-17 12:30:30', periods=1, freq='D')
314327
.tz_localize('MST'))
315328
unixtimes = times.tz_convert('UTC').astype(np.int64)*1.0/10**9
329+
unixtimes = np.array(unixtimes)
316330
result = self.spa.earthsun_distance(unixtimes, 64.0, 1)
317331
assert_almost_equal(R, result, 6)
318332

Collapse file

‎setup.py‎

Copy file name to clipboardExpand all lines: setup.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
'pytz',
4646
'six',
4747
]
48-
SETUP_REQUIRES = ['pytest-runner']
4948
TESTS_REQUIRE = ['pytest', 'nose']
5049

5150
CLASSIFIERS = [
@@ -96,7 +95,6 @@
9695
cmdclass=versioneer.get_cmdclass(),
9796
packages=PACKAGES,
9897
install_requires=INSTALL_REQUIRES,
99-
setup_requires=SETUP_REQUIRES,
10098
tests_require=TESTS_REQUIRE,
10199
ext_modules=extensions,
102100
description=DESCRIPTION,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.