[plotter] bugfix
This commit is contained in:
+13
-6
@@ -301,15 +301,21 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
nums = self.nums
|
||||
|
||||
datafiles = []
|
||||
if movie:
|
||||
filenames = []
|
||||
|
||||
if rule.kind == "snapshot" or rule.kind == "cells":
|
||||
run_num = [(run, num) for run in runs for num in nums[run]]
|
||||
if movie:
|
||||
filenames = {run : [] for run in runs}
|
||||
elif rule.kind == "comp":
|
||||
run_num = [(None, None)]
|
||||
if movie:
|
||||
self._log(f"No movie possible for rule {name}", "WARNING")
|
||||
movie = False
|
||||
else:
|
||||
run_num = [(run, None) for run in runs]
|
||||
if movie:
|
||||
self._log(f"No movie possible for rule {name}", "WARNING")
|
||||
movie = False
|
||||
|
||||
onefigure = False # If axes are provided, only save/close once
|
||||
if ax is not None:
|
||||
@@ -365,7 +371,7 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
df = rule.datafile(name, arg)
|
||||
df[filetype] = plot_filename
|
||||
if movie:
|
||||
filenames.append(plot_filename)
|
||||
filenames[run].append(plot_filename)
|
||||
if plot_info is not None:
|
||||
df.plot_info = plot_info
|
||||
if num is not None:
|
||||
@@ -382,9 +388,10 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
datafiles.append(df)
|
||||
|
||||
if movie:
|
||||
clip = ImageSequenceClip(filenames, fps=movie_fps)
|
||||
movie_filename = self._find_filename(name_full)
|
||||
movie.filename = os.path.splitext(movie_filename)[0] + ".mp4"
|
||||
for run in runs:
|
||||
clip = ImageSequenceClip(filenames[run], fps=movie_fps)
|
||||
movie_filename = self._find_filename(name_full, run=run)
|
||||
movie_filename = os.path.splitext(movie_filename)[0] + ".mp4"
|
||||
clip.write_videofile(movie_filename)
|
||||
|
||||
return datafiles
|
||||
|
||||
Reference in New Issue
Block a user