Skip to content

Commit

Permalink
refactor of load.cleanResult
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeline committed Oct 7, 2024
1 parent 84e7121 commit dbf2062
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions bifacial_radiance/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,10 @@ def cleanResult(resultsDF, matchers=None):

if matchers is None:
matchers = ['sky','pole','tube','bar','ground', '3267', '1540']
try:
NaNindex = [i for i,s in enumerate(resultsDF['mattype']) if any(xs in s for xs in matchers)]
for i in NaNindex:
resultsDF.loc[i,'Wm2Front'] = np.nan
except KeyError:
pass

try:
NaNindex2 = [i for i,s in enumerate(resultsDF['rearMat']) if any(xs in s for xs in matchers)]
for i in NaNindex2:
resultsDF.loc[i,'Wm2Back'] = np.nan
except KeyError:
pass
if ('mattype' in resultsDF) & ('Wm2Front' in resultsDF) :
resultsDF.loc[resultsDF.mattype.str.contains('|'.join(matchers)),'Wm2Front'] = np.nan
if ('rearMat' in resultsDF) & ('Wm2Back' in resultsDF) :
resultsDF.loc[resultsDF.rearMat.str.contains('|'.join(matchers)),'Wm2Back'] = np.nan

return resultsDF

Expand Down

0 comments on commit dbf2062

Please sign in to comment.