Repository navigation
[skip-ci][rfile] Add RFile python doc - #23633
silverweed wants to merge 1 commit into
Conversation
vepadulano
left a comment
There was a problem hiding this comment.
Thanks a lot! A few comments from my side.
| \code{.py} | ||
| # Reading an object from file. Note that Get will return None if no object is stored under the given path. | ||
| with ROOT.Experimental.RFile.Open("myfile.root") as file: | ||
| myHisto = file.Get("myHisto") |
There was a problem hiding this comment.
Just a side note, other Python interface e.g. the dictionary have a get method which raises error by default and optionally returns a default argument which could be None e.g. get("mykey", None).
There was a problem hiding this comment.
This is currently the behavior on the C++ side; if we strongly believe we should change it we should change it for both languages, but I'd avoid having it behave differently. We still have a bit of time to decide before moving RFile out of Experimental.
There was a problem hiding this comment.
I wouldn't object keeping things as they are, as long as they're properly documented. If you want to have this discussion with other ROOT team members let me know.
e127376 to
a3cbd58
Compare
jblomer
left a comment
There was a problem hiding this comment.
In principal looks good to me. Should we mention Tree/RNTuple with RFile in this doc?
Yes, but for RNTuple we should probably wait that at least For TTree we can mention that it may be read but not written. For both we probably want to redirect to the respective tutorials, which is why I'd wait this PR to be merged before doing so. |
vepadulano
left a comment
There was a problem hiding this comment.
Thank you, this was definitely important to address!
| \code{.py} | ||
| # Reading an object from file. Note that Get will return None if no object is stored under the given path. | ||
| with ROOT.Experimental.RFile.Open("myfile.root") as file: | ||
| myHisto = file.Get("myHisto") |
There was a problem hiding this comment.
I wouldn't object keeping things as they are, as long as they're properly documented. If you want to have this discussion with other ROOT team members let me know.
No description provided.