From 1eb3ccff7cbeb6bb726d366d10e3ee26de4efaa9 Mon Sep 17 00:00:00 2001 From: David Robert Verelst <dave@dtu.dk> Date: Sat, 8 Jul 2017 11:34:28 +0200 Subject: [PATCH] prepost: typo in dlctemplate and do not plot empty fig in dlcplots --- wetb/prepost/dlcplots.py | 11 ++++++++--- wetb/prepost/dlctemplate.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/wetb/prepost/dlcplots.py b/wetb/prepost/dlcplots.py index 69b4e95a..7074cdda 100644 --- a/wetb/prepost/dlcplots.py +++ b/wetb/prepost/dlcplots.py @@ -320,6 +320,9 @@ def plot_dlc_stats(df_stats, plot_chans, fig_dir_base, labels=None, windoffset = [-0.2, 0.2] else: windoffset = [0] + # in case of a fully empty plot xlims will remain None and there + # is no need to save the plot + xlims = None # instead of groupby, select the run_dir in the same order as # occuring in the labels, post_dirs lists for ii, run_dir in enumerate(run_dirs): @@ -384,12 +387,14 @@ def plot_dlc_stats(df_stats, plot_chans, fig_dir_base, labels=None, # if str(dlc_name) not in ['61', '62']: # ax.set_xticks(gr_ch_dlc_sid['[Windspeed]'].values) + # don't save empyt plots + if xlims is None: + continue + ax.grid() ax.set_xlim(xlims) leg = ax.legend(loc='best', ncol=3) - # if no data at all was found - if leg is not None: - leg.get_frame().set_alpha(0.7) + leg.get_frame().set_alpha(0.7) ax.set_title(r'{DLC%s} %s' % (dlc_name, ch_dscr)) ax.set_xlabel(xlabel) fig.tight_layout() diff --git a/wetb/prepost/dlctemplate.py b/wetb/prepost/dlctemplate.py index b9f2e24b..1a12702e 100644 --- a/wetb/prepost/dlctemplate.py +++ b/wetb/prepost/dlctemplate.py @@ -556,7 +556,7 @@ if __name__ == '__main__': P_RUN, P_SOURCE, PROJECT, sim_id, P_MASTERFILE, MASTERFILE, POST_DIR \ = dlcdefs.configure_dirs(verbose=True) - if opt.gendlc: + if opt.gendlcs: DLB = GenerateDLCCases() DLB.execute(filename=os.path.join(P_SOURCE, opt.dlcmaster), folder=os.path.join(P_RUN, opt.dlcfolder)) -- GitLab