Skip to content

Update from issue review #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2025
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pip install servicex-analysis-utils


Returns:
dict: keys are sample names and values are awkward arrays or dask-awkward arrays.
dict: keys are sample names and values are awkward arrays, uproot generator objects or dask-awkward arrays.
```

## Documentation
Expand Down
6 changes: 2 additions & 4 deletions servicex_analysis_utils/materialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def to_awk(deliver_dict, dask=False, **kwargs):


Returns:
dict: keys are sample names and values are awkward arrays or dask-awkward arrays.
dict: keys are sample names and values are awkward arrays, uproot generator objects or dask-awkward arrays.
"""

awk_arrays = {}
Expand All @@ -69,9 +69,7 @@ def to_awk(deliver_dict, dask=False, **kwargs):
else:
if is_root==True:
# Use uproot.iterate to handle URLs and local paths files in chunks
tmp_arrays = list(uproot.iterate(paths, library="ak", **kwargs))
# Merge arrays
awk_arrays[sample] = ak.concatenate(tmp_arrays)
awk_arrays[sample]=uproot.iterate(paths, library="ak", **kwargs) # not an ak array but a generator
else:
#file is parquet
awk_arrays[sample] = ak.from_parquet(paths, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_materialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def test_to_awk(build_test_samples):

#Collecting all samples
assert list(result.keys())==["Test-Sample1", "Test-Sample2"]
arr1=result["Test-Sample1"]
arr2=result["Test-Sample2"]
arr1 = ak.concatenate(list(result["Test-Sample1"])) # Materialize the generator from uproot.iterate
arr2 = ak.concatenate(list(result["Test-Sample2"]))

#Collecting all branches
assert ak.fields(arr1) == ['branch1', 'branch2']
Expand Down