Skip to content
Snippets Groups Projects
Commit 4376e797 authored by David Verelst's avatar David Verelst
Browse files

prepost.dlctemplate: save unique channels, find failed cases from chunks

parent 53b3139b
No related branches found
No related tags found
No related merge requests found
......@@ -412,6 +412,11 @@ def post_launch(sim_id, statistics=True, rem_failed=True, check_logs=True,
suffix=suffix, save_new_sigs=save_new_sigs,
csv=csv, m=m, neq=None, no_bins=no_bins,
chs_resultant=[], A=A, add_sigs={})
# save channel list
chans = df_stats['channel'].unique()
chans.sort()
fname = os.path.join(POST_DIR, '%s_unique-channel-names.csv' % sim_id)
pd.DataFrame(chans).to_csv(fname)
# annual energy production
if AEP:
......@@ -538,8 +543,8 @@ def postpro_node_merge(tqdm=False, zipchunks=False):
df['[case_id]'] = tmp[tmp.columns[-1]]
cc = sim.Cases(POST_DIR, sim_id)
df_tags = cc.cases2df()[required]
df_stats = pd.merge(df, df_tags, on=['[case_id]'])
df_tags = cc.cases2df()
df_stats = pd.merge(df, df_tags[required], on=['[case_id]'])
# if the merge didn't work due to other misaligned case_id tags, do not
# overwrite our otherwise ok tables!
if len(df_stats) != len(df):
......@@ -557,6 +562,17 @@ def postpro_node_merge(tqdm=False, zipchunks=False):
df_stats.to_hdf(fdf, 'table', mode='w')
df_stats.to_csv(fdf.replace('.h5', '.csv'))
# -------------------------------------------------------------------------
# save channel list
chans = df_stats['channel'].unique()
chans.sort()
fname = os.path.join(POST_DIR, '%s_unique-channel-names.csv' % sim_id)
pd.DataFrame(chans).to_csv(fname)
# -------------------------------------------------------------------------
# created failed cases list
cc.find_failed(df_cases=df_tags)
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment