[params] fix subfolder
This commit is contained in:
+10
-7
@@ -374,6 +374,7 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
for run in runs:
|
||||
clip = ImageSequenceClip(filenames[run], fps=movie_fps)
|
||||
movie_filename = self._find_filename(name_full, run=run, ext=".mp4")
|
||||
os.makedirs(os.path.dirname(movie_filename), exist_ok=True)
|
||||
clip.write_videofile(movie_filename)
|
||||
|
||||
return datafiles
|
||||
@@ -390,6 +391,7 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
plt.tight_layout(pad=1)
|
||||
|
||||
if self.params.out.save:
|
||||
os.makedirs(os.path.dirname(plot_filename), exist_ok=True)
|
||||
plt.savefig(plot_filename)
|
||||
self._log("{} plotted".format(plot_filename), "SUCCESS")
|
||||
else:
|
||||
@@ -408,8 +410,12 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
Determine a filename based on rule name, run, output and parameters
|
||||
"""
|
||||
tag_name = self.params.out.tag
|
||||
|
||||
if ext is None:
|
||||
ext = self.params.out.ext
|
||||
|
||||
if self.params.out.ext_subfolder:
|
||||
subfolder = "/{ext[1:]}/"
|
||||
subfolder = f"/{ext[1:]}"
|
||||
else:
|
||||
subfolder = ""
|
||||
|
||||
@@ -418,11 +424,11 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
tag_name = "_" + tag_name
|
||||
|
||||
if run is not None and num is not None:
|
||||
fmt = "{out}/{run}/{subfolder}{name}{tag}_{run}_{num:05}{ext}"
|
||||
fmt = "{out}/{run}{subfolder}/{name}{tag}_{run}_{num:05}{ext}"
|
||||
elif run is not None:
|
||||
fmt = "{out}/{run}/{subfolder}{name}{tag}_{run}{ext}"
|
||||
fmt = "{out}/{run}{subfolder}/{name}{tag}_{run}{ext}"
|
||||
else:
|
||||
fmt = "{out}/{name}{subfolder}{tag}{ext}"
|
||||
fmt = "{out}{subfolder}/{name}{tag}{ext}"
|
||||
elif fmt is None:
|
||||
fmt = self.params.out.fmt
|
||||
|
||||
@@ -430,9 +436,6 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
if run is not None:
|
||||
nml = self.study.namelist[run]
|
||||
|
||||
if ext is None:
|
||||
ext = self.params.out.ext
|
||||
|
||||
return fmt.format(
|
||||
run=run,
|
||||
name=name_full,
|
||||
|
||||
Reference in New Issue
Block a user