-
Notifications
You must be signed in to change notification settings - Fork 76
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: implement TGraph-writing #1256
feat: implement TGraph-writing #1256
Conversation
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.
I didn't carefully check all the cases as described in lines 246 through 252 of interpret.py (the docstring of to_TGraph
). But it's good that there's an effective flow-chart/decision tree for these cases because the user will need to internalize it.
I only have a few code clean-up things below, and a likely solution to the test failures.
Co-authored-by: Jim Pivarski <[email protected]>
Co-authored-by: Jim Pivarski <[email protected]>
Co-authored-by: Jim Pivarski <[email protected]>
Co-authored-by: Jim Pivarski <[email protected]>
Co-authored-by: Jim Pivarski <[email protected]>
Co-authored-by: Jim Pivarski <[email protected]>
Co-authored-by: Jim Pivarski <[email protected]>
Co-authored-by: Jim Pivarski <[email protected]>
…hub.com/Pepesob/uproot5 into pepesob/implement-TGraph-interpretation
…eflects what it does: interpret as what? -> TGraph)
This is a nice design ! Can it be extended (maybe in future PR) to handle TMultiGraph as well ? I would like to save plots with different data series. Each serie would be separate collection of x,y pairs. Each serie may have different number of points. |
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.
Very nice! I'll make the suggested changes (below) myself, and then merge this PR if the tests pass. Thank you very much!
@grzanka said,
This is a nice design ! Can it be extended (maybe in future PR) to handle TMultiGraph as well ? I would like to save plots with different data series. Each serie would be separate collection of x,y pairs. Each serie may have different number of points.
That sounds like a good future PR. Would that be similar enough to include in the as_TGraph
function (which already covers three different classes), or would the interface be different enough to warrant a new function?
@all-contributors please add @Pepesob for code |
I've put up a pull request to add @Pepesob! 🎉 |
Implemented function
as_TGraph()
that gives to user possibilty to save DataFrame (or any dict like object) as TGraph.Example of usage:
List of arguments:
How does it work: