Skip to content

Commit

Permalink
Fixed save results
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiatoropovaa committed Dec 15, 2023
1 parent e460768 commit 7afac5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added bifacial_radiance/.DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4364,9 +4364,6 @@ def _saveResults(self, data=None, reardata=None, savefile=None, RGB = False, sav
data_sub = {key:data[key] for key in ['x', 'y', 'z', 'mattype', 'Wm2','r', 'g', 'b' ]}
else:
data_sub = {key:data[key] for key in ['x', 'y', 'z', 'mattype','Wm2' ]}

if savekey is None:
savekey = ''

df = pd.DataFrame(data_sub)
df = df.rename(columns={'Wm2':'Wm2Front'})
Expand All @@ -4390,7 +4387,10 @@ def _saveResults(self, data=None, reardata=None, savefile=None, RGB = False, sav
df = df.rename(columns={'Wm2Front':'Wm2Back','mattype':'rearMat'})
# set attributes of analysis to equal columns of df
for col in df.columns:
setattr(self, savekey+col, list(df[col]))
if savekey is not None:
setattr(self, savekey+col, list(df[col]))
else:
setattr(self, col, list(df[col]))
# only save a subset
df = df.drop(columns=['rearX','rearY','backRatio'], errors='ignore')
df.to_csv(os.path.join("results", savefile), sep = ',',
Expand Down

0 comments on commit 7afac5e

Please sign in to comment.