Skip to content

rename series_modules to modules_per_string and parallel_modules to strings_per_inverter #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/sphinx/source/whatsnew/v0.3.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ v0.3.3 (May xx, 2016)
This is a minor release from 0.3.2.
We recommend that all users upgrade to this version.


API Changes
~~~~~~~~~~~

* Renamed ``series_modules`` to ``modules_per_string`` and
``parallel_modules`` to ``strings_per_inverter``. (:issue:`176`)


Enhancements
~~~~~~~~~~~~

Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/pvsystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
" 'latitude': 55.317,\n",
" 'longitude': -160.517,\n",
" 'name': '\"SAND POINT\"',\n",
" 'parallel_modules': 5,\n",
" 'series_modules': 5,\n",
" 'strings_per_inverter': 5,\n",
" 'modules_per_string': 5,\n",
" 'surface_azimuth': 0,\n",
" 'surface_tilt': 0,\n",
" 'tz': -9.0}"
Expand Down Expand Up @@ -152,8 +152,8 @@
" 'latitude': 25.8,\n",
" 'longitude': -80.26666666666667,\n",
" 'name': 'MIAMI',\n",
" 'parallel_modules': 5,\n",
" 'series_modules': 5,\n",
" 'strings_per_inverter': 5,\n",
" 'modules_per_string': 5,\n",
" 'surface_azimuth': 0,\n",
" 'surface_tilt': 0,\n",
" 'tz': -5}"
Expand Down
41 changes: 21 additions & 20 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class PVSystem(object):
The class supports basic system topologies consisting of:

* `N` total modules arranged in series
(`series_modules=N`, `parallel_modules=1`).
(`modules_per_string=N`, `strings_per_inverter=1`).
* `M` total modules arranged in parallel
(`series_modules=1`, `parallel_modules=M`).
(`modules_per_string=1`, `strings_per_inverter=M`).
* `NxM` total modules arranged in `M` strings of `N` modules each
(`series_modules=N`, `parallel_modules=M`).
(`modules_per_string=N`, `strings_per_inverter=M`).

The class is complementary to the module-level functions.

Expand Down Expand Up @@ -78,10 +78,10 @@ class PVSystem(object):
module_parameters : None, dict or Series
Module parameters as defined by the SAPM, CEC, or other.

series_modules: int or float
modules_per_string: int or float
See system topology discussion above.

parallel_modules: int or float
strings_per_inverter: int or float
See system topology discussion above.

inverter : None, string
Expand Down Expand Up @@ -110,7 +110,7 @@ def __init__(self,
surface_tilt=0, surface_azimuth=180,
albedo=None, surface_type=None,
module=None, module_parameters=None,
series_modules=1, parallel_modules=1,
modules_per_string=1, strings_per_inverter=1,
inverter=None, inverter_parameters=None,
racking_model='open_rack_cell_glassback',
**kwargs):
Expand All @@ -129,8 +129,8 @@ def __init__(self,
self.module = module
self.module_parameters = module_parameters

self.series_modules = series_modules
self.parallel_modules = parallel_modules
self.modules_per_string = modules_per_string
self.strings_per_inverter = strings_per_inverter

self.inverter = inverter
self.inverter_parameters = inverter_parameters
Expand Down Expand Up @@ -382,7 +382,7 @@ def scale_voltage_current_power(self, data):
"""
Scales the voltage, current, and power of the DataFrames
returned by :py:func:`singlediode` and :py:func:`sapm`
by `self.series_modules` and `self.parallel_modules`.
by `self.modules_per_string` and `self.strings_per_inverter`.

Parameters
----------
Expand All @@ -396,8 +396,9 @@ def scale_voltage_current_power(self, data):
A scaled copy of the input data.
"""

return scale_voltage_current_power(data, voltage=self.series_modules,
current=self.parallel_modules)
return scale_voltage_current_power(data,
voltage=self.modules_per_string,
current=self.strings_per_inverter)

def localize(self, location=None, latitude=None, longitude=None,
**kwargs):
Expand Down Expand Up @@ -454,8 +455,8 @@ def __init__(self, pvsystem=None, location=None, **kwargs):
super(LocalizedPVSystem, self).__init__(**new_kwargs)


def systemdef(meta, surface_tilt, surface_azimuth, albedo, series_modules,
parallel_modules):
def systemdef(meta, surface_tilt, surface_azimuth, albedo, modules_per_string,
strings_per_inverter):
'''
Generates a dict of system parameters used throughout a simulation.

Expand Down Expand Up @@ -493,10 +494,10 @@ def systemdef(meta, surface_tilt, surface_azimuth, albedo, series_modules,
(land), may increase over snow, ice, etc. May also be known as
the reflection coefficient. Must be >=0 and <=1.

series_modules : int
modules_per_string : int
Number of modules connected in series in a string.

parallel_modules : int
strings_per_inverter : int
Number of strings connected in parallel.

Returns
Expand All @@ -508,8 +509,8 @@ def systemdef(meta, surface_tilt, surface_azimuth, albedo, series_modules,
* 'surface_tilt'
* 'surface_azimuth'
* 'albedo'
* 'series_modules'
* 'parallel_modules'
* 'modules_per_string'
* 'strings_per_inverter'
* 'latitude'
* 'longitude'
* 'tz'
Expand All @@ -530,8 +531,8 @@ def systemdef(meta, surface_tilt, surface_azimuth, albedo, series_modules,
system = {'surface_tilt': surface_tilt,
'surface_azimuth': surface_azimuth,
'albedo': albedo,
'series_modules': series_modules,
'parallel_modules': parallel_modules,
'modules_per_string': modules_per_string,
'strings_per_inverter': strings_per_inverter,
'latitude': meta['latitude'],
'longitude': meta['longitude'],
'tz': meta['TZ'],
Expand Down Expand Up @@ -1732,7 +1733,7 @@ def scale_voltage_current_power(data, voltage=1, current=1):
# could make it work with a dict, but it would be more verbose
data = data.copy()
voltages = ['v_mp', 'v_oc']
currents = ['i_mp' ,'i_x', 'i_xx', 'i_sc']
currents = ['i_mp', 'i_x', 'i_xx', 'i_sc']
data[voltages] *= voltage
data[currents] *= current
data['p_mp'] *= voltage * current
Expand Down
14 changes: 7 additions & 7 deletions pvlib/test/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def test_systemdef_tmy3():
'latitude': 55.317,
'longitude': -160.517,
'name': '"SAND POINT"',
'parallel_modules': 5,
'series_modules': 5,
'strings_per_inverter': 5,
'modules_per_string': 5,
'surface_azimuth': 0,
'surface_tilt': 0}
assert_equals(expected, pvsystem.systemdef(tmy3_metadata, 0, 0, .1, 5, 5))
Expand All @@ -68,8 +68,8 @@ def test_systemdef_tmy2():
'latitude': 25.8,
'longitude': -80.26666666666667,
'name': 'MIAMI',
'parallel_modules': 5,
'series_modules': 5,
'strings_per_inverter': 5,
'modules_per_string': 5,
'surface_azimuth': 0,
'surface_tilt': 0}
assert_equals(expected, pvsystem.systemdef(tmy2_metadata, 0, 0, .1, 5, 5))
Expand All @@ -81,8 +81,8 @@ def test_systemdef_dict():
'latitude': 37.8,
'longitude': -122.3,
'name': 'Oakland',
'parallel_modules': 5,
'series_modules': 5,
'strings_per_inverter': 5,
'modules_per_string': 5,
'surface_azimuth': 0,
'surface_tilt': 5}
assert_equals(expected, pvsystem.systemdef(meta, 5, 0, .1, 5, 5))
Expand Down Expand Up @@ -314,7 +314,7 @@ def test_PVSystem_scale_voltage_current_power():
np.array([[6, 4.5, 20, 16, 72, 1.5, 4.5]]),
columns=['i_sc', 'i_mp', 'v_oc', 'v_mp', 'p_mp', 'i_x', 'i_xx'],
index=[0])
system = pvsystem.PVSystem(series_modules=2, parallel_modules=3)
system = pvsystem.PVSystem(modules_per_string=2, strings_per_inverter=3)
out = system.scale_voltage_current_power(data)


Expand Down