root/root-np32.patch
Mattias Ellert 59989efa5f Update to 6.30.00
Removed subpackages: root-io-gfal and root-roofit-common
Dropped patches: 6
New patches: 6
2023-11-26 16:11:31 +01:00

89 lines
5.2 KiB
Diff

From 88162e7738d810f8203ed0242179f7af94ded500 Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Fri, 17 Nov 2023 11:46:14 +0100
Subject: [PATCH 3/3] Fix pythonizations test errors on ix86 Linux
======================================================================
ERROR: test_sliced_array (rdataframe_makenumpy.DataFrameFromNumpy.test_sliced_array)
Test correct reading of a sliced numpy array (#13690)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/root-6.30.00/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py", line 153, in test_sliced_array
x_col = df.Take['Long64_t']("x")
^^^^^^^^^^^^^^^^^^^^^^^^
cppyy.gbl.std.runtime_error: Could not instantiate Take<Long64_t>:
ROOT::RDF::RResultPtr<vector<Long64_t> > ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Take(basic_string_view<char,char_traits<char> > column = "") =>
runtime_error: Column x has type int while the id specified is associated to type Long64_t
----------------------------------------------------------------------
======================================================================
ERROR: test_dtypes (rtensor.AsRTensor.test_dtypes)
Test adoption of numpy arrays with different data types
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/root-6.30.00/bindings/pyroot/pythonizations/test/rtensor.py", line 45, in test_dtypes
root_obj = ROOT.TMVA.Experimental.RTensor(self.cpptypes[i])(np_obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/root-6.30.00/redhat-linux-build/lib/ROOT/_pythonization/_tmva/_rtensor.py", line 131, in RTensorInit
return self._original_init_(data,shape,layout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: none of the 6 overloaded methods succeeded. Full details:
RTensor<long,vector<long> >::RTensor<long,vector<long> >(TMVA::Experimental::RTensor<long,vector<long> >&&) =>
TypeError: takes at most 1 arguments (3 given)
RTensor<long,vector<long> >::RTensor<long,vector<long> >(const TMVA::Experimental::RTensor<long,vector<long> >&) =>
TypeError: takes at most 1 arguments (3 given)
RTensor<long,vector<long> >::RTensor<long,vector<long> >(shared_ptr<vector<long> > container, vector<unsigned int> shape, TMVA::Experimental::MemoryLayout layout = MemoryLayout::RowMajor) =>
TypeError: could not convert argument 1
RTensor<long,vector<long> >::RTensor<long,vector<long> >(vector<unsigned int> shape, TMVA::Experimental::MemoryLayout layout = MemoryLayout::RowMajor) =>
TypeError: takes at most 2 arguments (3 given)
RTensor<long,vector<long> >::RTensor<long,vector<long> >(long* data, vector<unsigned int> shape, vector<unsigned int> strides, TMVA::Experimental::MemoryLayout layout = MemoryLayout::RowMajor) =>
TypeError: could not convert argument 1 (could not convert argument to buffer or nullptr)
RTensor<long,vector<long> >::RTensor<long,vector<long> >(long* data, vector<unsigned int> shape, TMVA::Experimental::MemoryLayout layout = MemoryLayout::RowMajor) =>
TypeError: could not convert argument 1 (could not convert argument to buffer or nullptr)
----------------------------------------------------------------------
---
.../pyroot/pythonizations/test/rdataframe_makenumpy.py | 2 +-
bindings/pyroot/pythonizations/test/rtensor.py | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py b/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py
index cd2ebc9b5b..1860bd49f5 100644
--- a/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py
+++ b/bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py
@@ -147,7 +147,7 @@ class DataFrameFromNumpy(unittest.TestCase):
"""
Test correct reading of a sliced numpy array (#13690)
"""
- table = np.array([[1,2], [3,4]])
+ table = np.array([[1,2], [3,4]], dtype="int64")
columns = {'x': table[:,0], 'y': table[:,1]}
df = ROOT.RDF.FromNumpy(columns)
x_col = df.Take['Long64_t']("x")
diff --git a/bindings/pyroot/pythonizations/test/rtensor.py b/bindings/pyroot/pythonizations/test/rtensor.py
index 99b458cfa9..070a5d24d0 100644
--- a/bindings/pyroot/pythonizations/test/rtensor.py
+++ b/bindings/pyroot/pythonizations/test/rtensor.py
@@ -3,6 +3,7 @@ import ROOT
RTensor = ROOT.TMVA.Experimental.RTensor
import numpy as np
import platform
+import sys
def check_shape(root_obj, np_obj):
@@ -28,8 +29,10 @@ class AsRTensor(unittest.TestCase):
"""
Test adoption of numpy arrays with different data types
"""
- #using long long on Linux does not work although it is same size as long
- if (platform.system() == "Windows") :
+ # Using long long on 64 bit Linux does not work although it is
+ # same size as long
+ if ((platform.system() == "Windows") or
+ ((platform.system() == "Linux") and (sys.maxsize < 2**32))) :
self.cpptypes[1] = "long long"
self.cpptypes[3] = "unsigned long long"
--
2.42.0