Skip to content

Commit d216ebe

Browse files
remove pvsystem.systemdef (#1008)
* remove pvsystem.systemdef * remove systemdef from pvsystem.ipynb * whatsnew * remove from api.rst * Update docs/sphinx/source/whatsnew/v0.8.0.rst Co-authored-by: Kevin Anderson <[email protected]> * one line import * correct api changes section Co-authored-by: Kevin Anderson <[email protected]>
1 parent 8480af3 commit d216ebe

File tree

5 files changed

+240
-4013
lines changed

5 files changed

+240
-4013
lines changed

docs/sphinx/source/api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ Other
328328
:toctree: generated/
329329

330330
pvsystem.retrieve_sam
331-
pvsystem.systemdef
332331
pvsystem.scale_voltage_current_power
333332

334333

docs/sphinx/source/whatsnew/v0.8.0.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ API Changes
2525
* The tkinter-based file selection dialog has been removed from
2626
:py:func:`pvlib.iotools.read_tmy2` and :py:func:`pvlib.iotools.read_tmy3`;
2727
the filepath is now a required parameter. (:pull:`1004`)
28+
* Removed ``systemdef`` function from ``pvsystem.py``. This function was not
29+
used in pvlib and its output was not directly compatible with any pvlib
30+
function. See :py:func:`pvlib.iotools.read_tmy2`,
31+
:py:func:`pvlib.iotools.read_tmy3`, :py:meth:`pvlib.location.Location.from_tmy`, and
32+
:py:class:`pvlib.pvsystem.LocalizedPVSystem` for alternatives. (:issue:`965`)
33+
(:pull:`1008`)
2834

2935
Enhancements
3036
~~~~~~~~~~~~

docs/tutorials/pvsystem.ipynb

Lines changed: 232 additions & 3866 deletions
Large diffs are not rendered by default.

pvlib/pvsystem.py

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -903,93 +903,6 @@ def __repr__(self):
903903
('{}: {}'.format(attr, getattr(self, attr)) for attr in attrs)))
904904

905905

906-
def systemdef(meta, surface_tilt, surface_azimuth, albedo, modules_per_string,
907-
strings_per_inverter):
908-
'''
909-
Generates a dict of system parameters used throughout a simulation.
910-
911-
Parameters
912-
----------
913-
914-
meta : dict
915-
meta dict either generated from a TMY file using readtmy2 or
916-
readtmy3, or a dict containing at least the following fields:
917-
918-
=============== ====== ====================
919-
meta field format description
920-
=============== ====== ====================
921-
meta.altitude Float site elevation
922-
meta.latitude Float site latitude
923-
meta.longitude Float site longitude
924-
meta.Name String site name
925-
meta.State String state
926-
meta.TZ Float timezone
927-
=============== ====== ====================
928-
929-
surface_tilt : float or Series
930-
Surface tilt angles in decimal degrees.
931-
The tilt angle is defined as degrees from horizontal
932-
(e.g. surface facing up = 0, surface facing horizon = 90)
933-
934-
surface_azimuth : float or Series
935-
Surface azimuth angles in decimal degrees.
936-
The azimuth convention is defined
937-
as degrees east of north
938-
(North=0, South=180, East=90, West=270).
939-
940-
albedo : float or Series
941-
Ground reflectance, typically 0.1-0.4 for surfaces on Earth
942-
(land), may increase over snow, ice, etc. May also be known as
943-
the reflection coefficient. Must be >=0 and <=1.
944-
945-
modules_per_string : int
946-
Number of modules connected in series in a string.
947-
948-
strings_per_inverter : int
949-
Number of strings connected in parallel.
950-
951-
Returns
952-
-------
953-
Result : dict
954-
955-
A dict with the following fields.
956-
957-
* 'surface_tilt'
958-
* 'surface_azimuth'
959-
* 'albedo'
960-
* 'modules_per_string'
961-
* 'strings_per_inverter'
962-
* 'latitude'
963-
* 'longitude'
964-
* 'tz'
965-
* 'name'
966-
* 'altitude'
967-
968-
See also
969-
--------
970-
pvlib.iotools.read_tmy3
971-
pvlib.iotools.read_tmy2
972-
'''
973-
974-
try:
975-
name = meta['Name']
976-
except KeyError:
977-
name = meta['City']
978-
979-
system = {'surface_tilt': surface_tilt,
980-
'surface_azimuth': surface_azimuth,
981-
'albedo': albedo,
982-
'modules_per_string': modules_per_string,
983-
'strings_per_inverter': strings_per_inverter,
984-
'latitude': meta['latitude'],
985-
'longitude': meta['longitude'],
986-
'tz': meta['TZ'],
987-
'name': name,
988-
'altitude': meta['altitude']}
989-
990-
return system
991-
992-
993906
def calcparams_desoto(effective_irradiance, temp_cell,
994907
alpha_sc, a_ref, I_L_ref, I_o_ref, R_sh_ref, R_s,
995908
EgRef=1.121, dEgdT=-0.0002677,

pvlib/tests/test_pvsystem.py

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,65 +15,7 @@
1515
from pvlib import temperature
1616
from pvlib._deprecation import pvlibDeprecationWarning
1717

18-
from conftest import (
19-
needs_numpy_1_10, requires_scipy, fail_on_pvlib_version, DATA_DIR)
20-
21-
22-
def test_systemdef_tmy3():
23-
from pvlib.iotools import tmy
24-
tmy3_testfile = DATA_DIR / '703165TY.csv'
25-
tmy3_data, tmy3_metadata = tmy.read_tmy3(tmy3_testfile)
26-
expected = {'tz': -9.0,
27-
'albedo': 0.1,
28-
'altitude': 7.0,
29-
'latitude': 55.317,
30-
'longitude': -160.517,
31-
'name': '"SAND POINT"',
32-
'strings_per_inverter': 5,
33-
'modules_per_string': 5,
34-
'surface_azimuth': 0,
35-
'surface_tilt': 0}
36-
assert expected == pvsystem.systemdef(tmy3_metadata, 0, 0, .1, 5, 5)
37-
38-
39-
def test_systemdef_tmy2():
40-
from pvlib.iotools import tmy
41-
tmy2_testfile = DATA_DIR / '12839.tm2'
42-
tmy2_data, tmy2_metadata = tmy.read_tmy2(tmy2_testfile)
43-
44-
expected = {'tz': -5,
45-
'albedo': 0.1,
46-
'altitude': 2.0,
47-
'latitude': 25.8,
48-
'longitude': -80.26666666666667,
49-
'name': 'MIAMI',
50-
'strings_per_inverter': 5,
51-
'modules_per_string': 5,
52-
'surface_azimuth': 0,
53-
'surface_tilt': 0}
54-
assert expected == pvsystem.systemdef(tmy2_metadata, 0, 0, .1, 5, 5)
55-
56-
57-
def test_systemdef_dict():
58-
meta = {'latitude': 37.8,
59-
'longitude': -122.3,
60-
'altitude': 10,
61-
'Name': 'Oakland',
62-
'State': 'CA',
63-
'TZ': -8}
64-
65-
# Note that TZ is float, but Location sets tz as string
66-
expected = {'tz': -8,
67-
'albedo': 0.1,
68-
'altitude': 10,
69-
'latitude': 37.8,
70-
'longitude': -122.3,
71-
'name': 'Oakland',
72-
'strings_per_inverter': 5,
73-
'modules_per_string': 5,
74-
'surface_azimuth': 0,
75-
'surface_tilt': 5}
76-
assert expected == pvsystem.systemdef(meta, 5, 0, .1, 5, 5)
18+
from conftest import needs_numpy_1_10, requires_scipy, fail_on_pvlib_version
7719

7820

7921
@pytest.mark.parametrize('iam_model,model_params', [
@@ -104,6 +46,7 @@ def test_PVSystem_get_iam_interp(sapm_module_params, mocker):
10446
with pytest.raises(ValueError):
10547
system.get_iam(45, iam_model='interp')
10648

49+
10750
def test__normalize_sam_product_names():
10851

10952
BAD_NAMES = [' -.()[]:+/",', 'Module[1]']

0 commit comments

Comments
 (0)