Skip to content

Commit d53f387

Browse files
committed
Added labels for cecinverter [Issue 75]
1 parent 828af99 commit d53f387

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ This is a minor release from 0.2. It includes a large number of bug fixes
77
for the IPython notebook tutorials.
88
We recommend that all users upgrade to this version.
99

10+
Enhancements
11+
~~~~~~~~~~~~
12+
13+
* Update component info from SAM (csvs dated 2015-6-30) (:issue:`75`)
14+
15+
1016
Bug fixes
1117
~~~~~~~~~
1218

@@ -16,4 +22,5 @@ Bug fixes
1622
Contributors
1723
~~~~~~~~~~~~
1824

19-
* Will Holmgren
25+
* Will Holmgren
26+
* Jessica Forbess

pvlib/pvsystem.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def retrieve_sam(name=None, samfile=None):
537537
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-modules-2015-6-30.csv'
538538
elif name == 'sandiamod':
539539
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-sandia-modules-2015-6-30.csv'
540-
elif name == 'sandiainverter': # Still only one current inverter set, so left it as sandia, to avoid breaking old code
540+
elif name in ['cecinverter', 'sandiainverter']: # Allowing either, to provide for old code, while aligning with current expectations
541541
url = 'https://sam.nrel.gov/sites/sam.nrel.gov/files/sam-library-cec-inverters-2015-6-30.csv'
542542
elif samfile is None:
543543
raise ValueError('invalid name {}'.format(name))
@@ -562,6 +562,13 @@ def retrieve_sam(name=None, samfile=None):
562562

563563
def _parse_raw_sam_df(csvdata):
564564
df = pd.read_csv(csvdata, index_col=0, skiprows=[1,2])
565+
colnames = df.columns.values.tolist()
566+
parsedcolnames = []
567+
for cn in colnames:
568+
parsedcolnames.append(cn.replace(' ', '_'))
569+
570+
df.columns = parsedcolnames
571+
565572
parsedindex = []
566573
for index in df.index:
567574
parsedindex.append(index.replace(' ', '_').replace('-', '_')
@@ -646,7 +653,7 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
646653
Mbvmp Coefficient providing the irradiance dependence for the
647654
BetaVmp temperature coefficient at reference irradiance (V/C)
648655
N Empirically determined "diode factor" (dimensionless)
649-
Cells in Series Number of cells in series in a module's cell string(s)
656+
Cells_in_Series Number of cells in series in a module's cell string(s)
650657
IXO Ix at reference conditions
651658
IXXO Ixx at reference conditions
652659
FD Fraction of diffuse irradiance used by module
@@ -695,12 +702,12 @@ def sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi):
695702
(1 + module['Aimp']*(temp_cell - T0)) )
696703

697704
dfout['v_oc'] = (( module['Voco'] +
698-
module['Cells in Series']*delta*np.log(Ee) + Bvoco*(temp_cell - T0) )
705+
module['Cells_in_Series']*delta*np.log(Ee) + Bvoco*(temp_cell - T0) )
699706
.clip_lower(0))
700707

701708
dfout['v_mp'] = ( module['Vmpo'] +
702-
module['C2']*module['Cells in Series']*delta*np.log(Ee) +
703-
module['C3']*module['Cells in Series']*((delta*np.log(Ee)) ** 2) +
709+
module['C2']*module['Cells_in_Series']*delta*np.log(Ee) +
710+
module['C3']*module['Cells_in_Series']*((delta*np.log(Ee)) ** 2) +
704711
Bvmpo*(temp_cell - T0) ).clip_lower(0)
705712

706713
dfout['p_mp'] = dfout['i_mp'] * dfout['v_mp']

pvlib/test/test_pvsystem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_physicaliam():
9999
def test_retrieve_sam_network():
100100
sam_data['cecmod'] = pvsystem.retrieve_sam('cecmod')
101101
sam_data['sandiamod'] = pvsystem.retrieve_sam('sandiamod')
102-
sam_data['sandiainverter'] = pvsystem.retrieve_sam('sandiainverter')
102+
sam_data['cecinverter'] = pvsystem.retrieve_sam('cecinverter')
103103

104104

105105
def test_sapm():
@@ -180,7 +180,7 @@ def test_sapm_celltemp_with_index():
180180

181181

182182
def test_snlinverter():
183-
inverters = sam_data['sandiainverter']
183+
inverters = sam_data['cecinverter']
184184
testinv = 'ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'
185185
vdcs = pd.Series(np.linspace(0,50,3))
186186
idcs = pd.Series(np.linspace(0,11,3))
@@ -191,7 +191,7 @@ def test_snlinverter():
191191

192192

193193
def test_snlinverter_float():
194-
inverters = sam_data['sandiainverter']
194+
inverters = sam_data['cecinverter']
195195
testinv = 'ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'
196196
vdcs = 25.
197197
idcs = 5.5

0 commit comments

Comments
 (0)