[refactoring] and solve path_out bug
This commit is contained in:
+10
-10
@@ -119,9 +119,9 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
def __init__(
|
||||
self,
|
||||
path,
|
||||
in_runs=None,
|
||||
in_nums=None,
|
||||
path_out=None,
|
||||
runs=None,
|
||||
nums=None,
|
||||
path_out=".",
|
||||
params=None,
|
||||
selector=None,
|
||||
tag=None,
|
||||
@@ -136,13 +136,13 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
----------
|
||||
|
||||
path : path to the main folder of the simulations (ex '~/simus/myproject')
|
||||
in_runs : list of the runs to consider (ex ['run1', 'run2'])
|
||||
in_nums : list or dict of the outputs numbers to consider (ex [3, 5]
|
||||
runs : list of the runs to consider (ex ['run1', 'run2'])
|
||||
nums : list or dict of the outputs numbers to consider (ex [3, 5]
|
||||
or {'run1' : [3, 5], 'run2' : [4, 6])
|
||||
path_out : Path where the plot will be saved. By default set to `path`
|
||||
params : Parameters for postprocessing. See params module.
|
||||
selector : Existing instance of RunSelector, that selects runs and outputs. If set, in_runs and
|
||||
in_nums will be ignored
|
||||
selector : Existing instance of RunSelector, that selects runs and outputs. If set, runs and
|
||||
nums will be ignored
|
||||
tag : string to add in the output and data files.
|
||||
kwargs : Keyword arguments for RunSelector.
|
||||
"""
|
||||
@@ -152,7 +152,7 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
# Select runs
|
||||
if selector is None:
|
||||
self.selector = RunSelector(
|
||||
path, in_runs, in_nums, self.params.input.nml_filename, **kwargs
|
||||
path, runs, nums, self.params.input.nml_filename, **kwargs
|
||||
)
|
||||
else:
|
||||
self.selector = selector
|
||||
@@ -167,7 +167,7 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
path,
|
||||
self.runs,
|
||||
self.nums,
|
||||
path_out,
|
||||
self.path_out,
|
||||
self.params,
|
||||
unit_time=unit_time,
|
||||
selector=self.selector,
|
||||
@@ -305,7 +305,7 @@ class Plotter(Aggregator, BaseProcessor):
|
||||
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}
|
||||
filenames = {run: [] for run in runs}
|
||||
elif rule.kind == "comp":
|
||||
run_num = [(None, None)]
|
||||
if movie:
|
||||
|
||||
Reference in New Issue
Block a user