From 1a5c7ca0fa63d26bc4cfc64e5842d8d6fbef71d9 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 11 Apr 2023 17:10:00 -0500 Subject: [PATCH] working on dask systematics --- src/coffea/nanoevents/methods/base.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/coffea/nanoevents/methods/base.py b/src/coffea/nanoevents/methods/base.py index 687cffdc5c..3e84252d78 100644 --- a/src/coffea/nanoevents/methods/base.py +++ b/src/coffea/nanoevents/methods/base.py @@ -93,6 +93,7 @@ def add_systematic( kind: str, what: Union[str, List[str], Tuple[str]], varying_function: Callable, + _dask_array_=None, ): """ name: str, name of the systematic variation / uncertainty source @@ -100,6 +101,21 @@ def add_systematic( what: Union[str, List[str], Tuple[str]], name what gets varied, this could be a list or tuple of column names varying_function: Union[function, bound method], a function that describes how 'what' is varied, it must close over all non-event-data arguments. """ + if _dask_array_ is not None: + print("self", repr(self)) + print("name", name) + print("kind", kind) + print("what", repr(what)) + print("vf ", varying_function) + print("da ", _dask_array_, type(_dask_array_)) + _dask_array_.map_partitions( + _ClassMethodFn("add_systematic"), + name, + kind, + what, + varying_function, + ) + self._ensure_systematics() if name in awkward.fields(self["__systematics__"]):