Skip to content

Commit bfbdb23

Browse files
authored
improve function argument ordering in pvsystem (#220)
* make more pvsystem functions less pandas centric * update tests * change snlinverter api. update whatsnew * fix bad rebase in tools * add test decorators * reorder sapm function arguments * fix pre-python 3.5 syntax error in test
1 parent 6a43bcd commit bfbdb23

File tree

7 files changed

+201
-144
lines changed

7 files changed

+201
-144
lines changed

docs/sphinx/source/package_overview.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ to accomplish our system modeling goal:
105105
temps = pvlib.pvsystem.sapm_celltemp(total_irrad['poa_global'],
106106
wind_speed, temp_air)
107107
effective_irradiance = pvlib.pvsystem.sapm_effective_irradiance(
108-
module, total_irrad['poa_direct'], total_irrad['poa_diffuse'],
109-
am_abs, aoi)
110-
dc = pvlib.pvsystem.sapm(module, effective_irradiance, temps['temp_cell'])
111-
ac = pvlib.pvsystem.snlinverter(inverter, dc['v_mp'], dc['p_mp'])
108+
total_irrad['poa_direct'], total_irrad['poa_diffuse'],
109+
am_abs, aoi, module)
110+
dc = pvlib.pvsystem.sapm(effective_irradiance, temps['temp_cell'], module)
111+
ac = pvlib.pvsystem.snlinverter(dc['v_mp'], dc['p_mp'], inverter)
112112
annual_energy = ac.sum()
113113
energies[name] = annual_energy
114114

docs/sphinx/source/whatsnew/v0.4.0.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ API Changes
1919
in addition to arrays and Series. Furthermore, these functions no
2020
longer promote scalar or array input to Series output.
2121
Also applies to atmosphere.relativeairmass. (:issue:`201`, :issue:`214`)
22+
* Reorder the ashraeiam, physicaliam, and snlinverter arguments to put
23+
the most variable arguments first. Adds default arguments for the IAM
24+
functions. (:issue:`197`)
2225
* The irradiance.extraradiation function input/output type consistency
2326
across different methods has been dramatically improved.
2427
(:issue:`217`, :issue:`219`)

pvlib/modelchain.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ def basic_chain(times, latitude, longitude,
170170
weather['temp_air'])
171171

172172
effective_irradiance = pvsystem.sapm_effective_irradiance(
173-
module_parameters, total_irrad['poa_direct'],
174-
total_irrad['poa_diffuse'], airmass, aoi)
173+
total_irrad['poa_direct'], total_irrad['poa_diffuse'], airmass, aoi,
174+
module_parameters)
175175

176-
dc = pvsystem.sapm(module_parameters, effective_irradiance,
177-
temps['temp_cell'])
176+
dc = pvsystem.sapm(effective_irradiance, temps['temp_cell'],
177+
module_parameters)
178178

179-
ac = pvsystem.snlinverter(inverter_parameters, dc['v_mp'], dc['p_mp'])
179+
ac = pvsystem.snlinverter(dc['v_mp'], dc['p_mp'], inverter_parameters)
180180

181181
return dc, ac
182182

0 commit comments

Comments
 (0)