@@ -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
563563def _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' ]
0 commit comments