Skip to content
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

feat: add branches to existing TTree #1155

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ed6f4aa
Copies, details to work on though and haven't filled branches yet
zbilodea Apr 10, 2024
31fc9e4
Merge branch 'main' into feat-add-copy-ttree
zbilodea Apr 10, 2024
f1c2d57
Progress on adding data
zbilodea Apr 12, 2024
16544e0
style: pre-commit fixes
pre-commit-ci[bot] Apr 12, 2024
0d91275
Progress adding branches filled with data, have to fix some problems …
zbilodea Apr 18, 2024
2fc5e1c
style: pre-commit fixes
pre-commit-ci[bot] Apr 18, 2024
11503d6
fixed tLeaf bug, everything seems good on the surface
zbilodea Apr 18, 2024
efac6a7
ROOT can read both branch names/types now, but not the data
zbilodea Apr 30, 2024
e3cc527
Merge branch 'main' into feat-add-copy-ttree
zbilodea Apr 30, 2024
f93437f
Changed method of switching and deleting ttrees
zbilodea May 10, 2024
50e88a2
Merge branch 'main' into feat-add-copy-ttree
zbilodea May 10, 2024
49116fa
Added some streamer handling
zbilodea May 15, 2024
1bbf5d5
Merge branch 'main' into feat-add-copy-ttree
zbilodea May 15, 2024
404e92d
Small updates to streamers, updated docs, more in-depth tests
zbilodea May 16, 2024
2b986c1
Working on support for TBranchElements. Added some small tests
zbilodea May 30, 2024
7ce4df8
Merge branch 'main' into feat-add-copy-ttree
zbilodea May 30, 2024
76551f0
style: pre-commit fixes
pre-commit-ci[bot] May 30, 2024
f2de07d
Old branches now copied with just reference numbers changed, still ha…
zbilodea Jun 11, 2024
7c9b96c
Merge branch 'main' into feat-add-copy-ttree
zbilodea Jun 11, 2024
0b42253
Fixed writing, all tests are passing so far
zbilodea Jun 12, 2024
1236395
Added some version restraints
zbilodea Jul 4, 2024
afd9be8
Merge branch 'main' into feat-add-copy-ttree
zbilodea Jul 4, 2024
3f6db0f
Pytest issues
zbilodea Jul 5, 2024
29d360c
still pytest issues
zbilodea Jul 5, 2024
fd16269
style: pre-commit fixes
pre-commit-ci[bot] Jul 5, 2024
5a711ee
edited docs
zbilodea Jul 5, 2024
a1cbd0c
Now adding subbranch TLeaf refs to TTree metadata
zbilodea Jul 17, 2024
c487bb4
Merge branch 'main' into feat-add-copy-ttree
zbilodea Jul 17, 2024
c7825df
Merge branch 'main' into feat-add-copy-ttree
zbilodea Aug 13, 2024
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
1 change: 0 additions & 1 deletion src/uproot/interpretation/identify.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def _from_leaves_one(leaf, title):
for x in re.findall(_item_any_pattern, title)
):
is_jagged = True

return dims, is_jagged


Expand Down
5 changes: 3 additions & 2 deletions src/uproot/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ def read(cls, chunk, cursor, context, file, selffile, parent, concrete=None):
self._is_memberwise = False
old_breadcrumbs = context.get("breadcrumbs", ())
context["breadcrumbs"] = (*old_breadcrumbs, self)

self.hook_before_read(chunk=chunk, cursor=cursor, context=context, file=file)
forth_obj = uproot._awkwardforth.get_forth_obj(context)
if forth_obj is not None:
Expand All @@ -798,6 +797,7 @@ def read(cls, chunk, cursor, context, file, selffile, parent, concrete=None):
if context.get("reading", True):
temp_index = cursor._index
self.read_numbytes_version(chunk, cursor, context)

length = cursor._index - temp_index
if length != 0 and forth_obj is not None:
forth_stash.pre_code.append(f"{length} stream skip\n")
Expand Down Expand Up @@ -843,6 +843,7 @@ def read(cls, chunk, cursor, context, file, selffile, parent, concrete=None):
cursor.skip(4)

if context.get("reading", True):

self.hook_before_read_members(
chunk=chunk, cursor=cursor, context=context, file=file
)
Expand All @@ -868,7 +869,7 @@ def read(cls, chunk, cursor, context, file, selffile, parent, concrete=None):
out = self.postprocess(chunk, cursor, context, file)

context["breadcrumbs"] = old_breadcrumbs

# print(out)
return out

def read_numbytes_version(self, chunk, cursor, context):
Expand Down
1 change: 1 addition & 0 deletions src/uproot/models/TBranch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import uproot
import uproot.models.TH
import uproot.models.TObjArray

_tbranch10_format1 = struct.Struct(">iiiiqiIiqqq")
_tbranch10_dtype1 = numpy.dtype(">i4")
Expand Down
2 changes: 1 addition & 1 deletion src/uproot/models/TNamed.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def read_members(self, chunk, cursor, context, file):
concrete=self.concrete,
)
)

# print("tnamed", context, chunk.raw_data.tobytes())
self._members["fName"] = cursor.string(chunk, context)
self._members["fTitle"] = cursor.string(chunk, context)

Expand Down
Loading
Loading