Skip to content

Commit

Permalink
working on dask systematics
Browse files Browse the repository at this point in the history
  • Loading branch information
lgray committed Jan 13, 2024
1 parent cf1334d commit 1a5c7ca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/coffea/nanoevents/methods/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,29 @@ 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
kind: str, the name of the kind of systematic variation
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__"]):
Expand Down

0 comments on commit 1a5c7ca

Please sign in to comment.