-
Notifications
You must be signed in to change notification settings - Fork 77
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 TLeafC - string - writing support #940
Conversation
These offsets are measured in bytes, starting from the beginning of the TKey. They do not include the last, so we have to get the last offset from As for what the two "4 bytes" X values are, see the jagged array writer. Example to follow: >>> import uproot, skhep_testdata
>>> uproot.open(skhep_testdata.data_path("uproot-simple.root"))["tree"]["three"].array()
<Array ['uno', 'dos', 'tres', 'quatro'] type='4 * string'> |
…e than 254 bytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just needs one more test to pass. See below!
"unu", | ||
"doi", | ||
"trei", | ||
"patru", | ||
"cinci", | ||
"sase", | ||
"sapte", | ||
"opt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
…sed data ignore the last offset as ROOT does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic! It's great to see this working!
I added some tests of extreme situations, to make sure that fLen is increasing as it should be before and after write_anew
, that length-zero string arrays can be written, and that ROOT is still okay with all of these cases. (I had to guess that fLen
should be 0
when there are no strings. I could be wrong and maybe it ought to be 1
. ROOT didn't complain, though.)
If you have any counter-edits, go ahead and apply them, otherwise, feel free to squash-and-merge.
No description provided.