ROOT Version: 6.32.14: Passed / 6.36.02: Failed
Platform: linuxx8664gcc
Compiler: c++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Hello,
Summary
Serialisation of a TMatrixD
with TBufferJSON::ToJSON()
triggers a Failed to instantiate
error in Python with ROOT 6.36.
Packages
I tested your packages for Ubuntu 24:
- https://root.cern/download/root_v6.32.14.Linux-ubuntu24.04-x86_64-gcc13.3.tar.gz
- https://root.cern/download/root_v6.36.02.Linux-ubuntu24.04-x86_64-gcc13.3.tar.gz
Python Tests
ROOT 6.32
$ root -q
------------------------------------------------------------------
| Welcome to ROOT 6.32.14 https://root.cern |
| (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Jun 05 2025, 07:08:58 |
| From tags/v6-32-14@v6-32-14 |
| With c++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
$ python3 -c "import ROOT; print(ROOT.TBufferJSON.ToJSON(ROOT.TMatrixD()))"
{
"_typename" : "TMatrixT<double>",
"fUniqueID" : 0,
"fBits" : 0,
"fNrows" : 0,
"fNcols" : 0,
"fRowLwb" : 0,
"fColLwb" : 0,
"fNelems" : 0,
"fNrowIndex" : 0,
"fTol" : 0,
"fElements" : []
}
ROOT 6.36
$ root -q
------------------------------------------------------------------
| Welcome to ROOT 6.36.02 https://root.cern |
| (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Jul 08 2025, 22:04:21 |
| From tags/v6-36-02@v6-36-02 |
| With c++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
$ python3 -c "import ROOT; print(ROOT.TBufferJSON.ToJSON(ROOT.TMatrixD()))"
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: Template method resolution failed:
Failed to instantiate "ToJSON()"
Discussions
- Is it the expected behaviour with ROOT 6.36?
- ROOT Version 6.36 Release Notes only seems to mention TBufferJSON not serializing std::map · Issue #18195 · root-project/root · GitHub which maybe unrelated.
- What is the correct way to serialise a
TMatrixT
withTBufferJSON
in ROOT 6.36 using Python?
Note
C++ test passed:
$ root -q -e "TMatrixD m; TBufferJSON::ToJSON(&m)"
------------------------------------------------------------------
| Welcome to ROOT 6.36.02 https://root.cern |
| (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Jul 08 2025, 22:04:21 |
| From tags/v6-36-02@v6-36-02 |
| With c++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
(TString) "{
"_typename" : "TMatrixT<double>",
"fUniqueID" : 0,
"fBits" : 0,
"fNrows" : 0,
"fNcols" : 0,
"fRowLwb" : 0,
"fColLwb" : 0,
"fNelems" : 0,
"fNrowIndex" : 0,
"fTol" : 0,
"fElements" : []
}"[209]
Best regards,