Add possibility to launch an external rule

+ some plotter improvements
+ some namelist improvements
+ add datacube extraction
This commit is contained in:
Noe Brucy
2022-08-23 10:10:42 +02:00
parent fcfd7a8dab
commit cdafe5cb61
5 changed files with 207 additions and 167 deletions
+8 -4
View File
@@ -2,8 +2,10 @@
import numpy as np
from functools import partial
from baseprocessor import Rule
import snapshotprocessor
try:
from mpi4py.futures import MPIPoolExecutor
@@ -25,9 +27,8 @@ def _map_aux(fun, path, path_out, params, run_num, **kwargs):
return fun(snap, **kwargs)
def _map_rule(snap, rule, arg, overwrite, overwrite_dep):
return snap.process(rule, arg, overwrite, overwrite_dep)
def _map_rule(snap, rule, **kwargs):
return snap.process(rule, **kwargs)
class Aggregator:
def get_snap_list(self, select=None):
@@ -41,8 +42,11 @@ class Aggregator:
def map(self, func, select=None, num_process=None, **kwargs):
snaps = self.get_snap_list(select)
if isinstance(func, Rule):
return self.map(_map_rule, select, num_process, rule=func, **kwargs)
snaps = self.get_snap_list(select)
if num_process is None:
num_process = self.params.process.num_process