Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ dev = [
"build",
"twine",
"pre-commit",
"ipykernel"
"ipykernel",
"dask-awkward",
"dask[complete]"
]
docs = ["mkdocs", "mkdocs-material", "mkdocstrings", "mkdocstrings-python"]

Expand Down
8 changes: 8 additions & 0 deletions src/pybes3/besio/root_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ def make_awkward_content(self, raw_data: dict):
awkward.contents.RecordArray(record_contents, list(raw_data.keys())),
)

def make_awkward_form(self):
raise NotImplementedError(
"make_awkward_form is not implemented for Bes3CgemClusterColFactory"
)


class Bes3SymMatrixArrayFactory(Factory):
target_items = {
Expand Down Expand Up @@ -299,6 +304,9 @@ def make_awkward_content(self, raw_data: np.ndarray):
)
)

def make_awkward_form(self):
return awkward.forms.NumpyForm("float64", inner_shape=[self.full_dim, self.full_dim])


uproot_custom.registered_factories |= {
Bes3TObjArrayFactory,
Expand Down
14 changes: 14 additions & 0 deletions tests/test_besio.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,20 @@ def test_symetric_matrix(arr):
test_symetric_matrix(tmp_arr)


def test_bes3_tobjarray_factory_dask(data_dir):
dask_arr = uproot.dask({data_dir / "test_full_mc_evt_1.rtraw": "Event/m_mdcDigiCol"})

dask_arr.compute()


def test_symetric_matrix_expansion_dask(data_dir):
dask_arr = uproot.dask(
{data_dir / "test_full_mc_evt_1.dst": "Event/TDstEvent/m_mdcTrackCol"}
)

dask_arr.compute()


def test_digi_expand_TRawData(data_dir):
f_rec = uproot.open(data_dir / "test_full_mc_evt_1.rec")
arr_digi = f_rec["Event/TDigiEvent"].arrays()
Expand Down
Loading