[ntuple][python][ATLAS experiment] Re-Implement context management pr…#22432
[ntuple][python][ATLAS experiment] Re-Implement context management pr…#22432rybkine wants to merge 1 commit into
Conversation
fcff6da to
c4e56cb
Compare
…otocol for RNTupleReader/Writer bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rntuple.py: add __enter__ method - returns self (an instance of RNTupleReader/RNTupleWriter), __exit__ method - calls RNTupleReader/RNTupleWriter destructor (if not destructed yet). tree/ntuple/test/ntuple_basics.py: update tests
c4e56cb to
52bc377
Compare
|
@vepadulano @silverweed Your reviews would be useful |
|
Perhaps, to say the obvious - the proposed implementation is virtually the same as that of the Python file object. And this is exactly what is needed here. |
vepadulano
left a comment
There was a problem hiding this comment.
I understand the feature request, but I'm not sure deleting the current implementation is the right approach. This PR is modifying quite a few tests which were present before, which is a sign of major changes and thus need to be carefully evaluated. I believe @jblomer and ultimately @silverweed should say whether/how the feature request should be addressed.
|
It is not a feature request - it is rather an alternative implementation proposed, which closely follows the implementation in the Python file object. Hence, the changes made. |
…otocol for RNTupleReader/Writer
bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rntuple.py: add
__enter__method - returns self (an instance of RNTupleReader/RNTupleWriter),__exit__method - calls RNTupleReader/RNTupleWriter destructor (if not destructed yet).tree/ntuple/test/ntuple_basics.py: update tests
This Pull request:
Changes or fixes:
Checklist:
This PR fixes #22431