]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
bos #40613 [CEA] deprecated np.float: backport patches to SHAPER, SOLVERLAB, HOMARD... V9_12_0
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 15 Jan 2024 15:27:03 +0000 (16:27 +0100)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 15 Jan 2024 15:27:03 +0000 (16:27 +0100)
applications/SALOME-9.12.0-native.pyconf
products/HOMARD.pyconf
products/PyFMI.pyconf
products/SHAPER.pyconf
products/SOLVERLAB.pyconf
products/patches/HOMARD-V9_12_0-numpy-1.20.-np.float.patch [new file with mode: 0644]
products/patches/PyFMI-2.6-numpy-1.20-np.float.patch [new file with mode: 0644]
products/patches/SHAPER-V9_12_0-numpy-1.20-np.float.patch [new file with mode: 0644]
products/patches/SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch [new file with mode: 0644]

index 7a88ef4acf61af876f2cfed0b0f79fa7d28c2a38..013501c5246cd043fad6a69e19ce8c16624574ca 100644 (file)
@@ -267,6 +267,9 @@ __overwrite__ :
         'APPLICATION.products.nlopt'            : '2.5.0'
         'APPLICATION.products.openturns'        : {tag: '1.21',  base: 'no', section: 'version_1_21_DB12'        }
         'APPLICATION.products.ParaView'         : {tag: '5.11.0',    base: 'no', section: 'version_5_11_0_MPI_DB12', hpc: 'yes' }
+        'APPLICATION.products.HOMARD'           : {tag: 'V9_12_0',   base: 'no', section: 'version_V9_12_0_DB12'}
+        'APPLICATION.products.SHAPER'           : {tag: 'V9_12_0',   base: 'no', section: 'version_V9_12_0_DB12'}
+        'APPLICATION.products.SOLVERLAB'        : {tag: 'V9_12_0',   base: 'no', section: 'version_V9_12_0_DB12'}
     }
     {
         # CentOS 8 repositories don't include sphinxintl package which must be installed through pip.
index 4b5964f0520fb10421261d92614c96664915703e..b8f43678236958a6a96e71469e0b71b2db2dbb26 100644 (file)
@@ -40,6 +40,11 @@ default_MPI :
   opt_depend : ['openmpi']
 }
 
+version_V9_12_0_DB12 :
+{
+    patches : ['HOMARD-V9_12_0-numpy-1.20.-np.float.patch']
+}
+
 version_V9_10_0_MPI :
 {
   cmake_options : "-DSWIG_EXECUTABLE=${SWIG_ROOT_DIR}/bin/swig -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER} -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER} -DSALOME_USE_MPI=ON "
index f30da845d8b49925126ef792b3de0fc228256f31..c22857a58e823865b31c7af59050e0fe45d08ced 100644 (file)
@@ -53,7 +53,7 @@ version_2_6_win :
 
 version_2_6_DB12:
 {
-    patches: ['pyfmi-2.6-python-3.1x.01.patch']
+    patches: ['pyfmi-2.6-python-3.1x.01.patch', 'PyFMI-2.6-numpy-1.20-np.float.patch']
     compil_script : "PyFMI-2.6.sh"
     properties:
     {
index 4e98383fe53085825e91d664b65075afe31e6c10..6eaab03605927fe25b38872a03d030eae0b5e9eb 100644 (file)
@@ -53,6 +53,11 @@ default_win :
     cmake_options :   " -DNO_SolveSpace=TRUE  -DSWIG_EXECUTABLE=%SWIG_ROOT_DIR:\=/%/bin/swig.exe " 
 }
 
+version_V9_12_0_DB12 :
+{
+    patches : ['SHAPER-V9_12_0-numpy-1.20-np.float.patch']
+}
+
 version_V9_10_0_FD37:
 {
   patches : ['SPNS-32377-SHAPER-V9_10_0-FD37.patch']
index 48d18edc36d4b349d7a8754fe49e62b1ec0be415..5a90b2f8115c771b96f50a4948973d572168a11c 100644 (file)
@@ -60,6 +60,11 @@ default_MPI :
     opt_depend : ['mpi4py']
 }
 
+version_V9_12_0_DB12 :
+{
+    patches : ['SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch']
+}
+
 version_V9_10_0 :
 {
     properties:
diff --git a/products/patches/HOMARD-V9_12_0-numpy-1.20.-np.float.patch b/products/patches/HOMARD-V9_12_0-numpy-1.20.-np.float.patch
new file mode 100644 (file)
index 0000000..3a6dbed
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/tests/Test/test_5.py b/src/tests/Test/test_5.py
+index 01baaa9..af1ec47 100755
+--- a/src/tests/Test/test_5.py
++++ b/src/tests/Test/test_5.py
+@@ -179,7 +179,7 @@ Python script for MEDCoupling
+     cg_hexa = cg_hexa_ml.toNumPyArray()
+ # Target
+ # ======
+-    xyz_p = np.zeros(3, dtype=np.float)
++    xyz_p = np.zeros(3, dtype=np.float32)
+     xyz_p[0] = -0.20*float(1-niter) * LG_X
+     xyz_p[1] = -0.15*float(1-niter) * LG_Y
+     xyz_p[2] = -0.10*float(1-niter) * LG_Z
diff --git a/products/patches/PyFMI-2.6-numpy-1.20-np.float.patch b/products/patches/PyFMI-2.6-numpy-1.20-np.float.patch
new file mode 100644 (file)
index 0000000..659ac20
--- /dev/null
@@ -0,0 +1,11 @@
+--- PyFMI-2.6_ref/src/pyfmi/fmi_coupled.pyx    2024-01-15 10:37:54.999574589 +0100
++++ PyFMI-2.6_dev/src/pyfmi/fmi_coupled.pyx    2024-01-15 10:37:43.735520048 +0100
+@@ -1004,7 +1004,7 @@
+         Calls the low-level FMI function: fmi2SetReal
+         """
+         input_valueref = np.array(valueref, ndmin=1).ravel()
+-        set_value      = np.array(values, dtype=np.float, ndmin=1).ravel()
++        set_value      = np.array(values, dtype=np.float32, ndmin=1).ravel()
+         if input_valueref.size != set_value.size:
+             raise fmi.FMUException('The length of valueref and values are inconsistent.')
diff --git a/products/patches/SHAPER-V9_12_0-numpy-1.20-np.float.patch b/products/patches/SHAPER-V9_12_0-numpy-1.20-np.float.patch
new file mode 100644 (file)
index 0000000..69cb4df
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/PythonAddons/macros/pipeNetwork/feature.py b/src/PythonAddons/macros/pipeNetwork/feature.py
+index 1ff9ec621..6fddccc34 100755
+--- a/src/PythonAddons/macros/pipeNetwork/feature.py
++++ b/src/PythonAddons/macros/pipeNetwork/feature.py
+@@ -232,7 +232,7 @@ Sorties :
+                 coox = self.infoPoints[l_noeuds[iaux+jaux]]["X"]
+                 cooy = self.infoPoints[l_noeuds[iaux+jaux]]["Y"]
+                 cooz = self.infoPoints[l_noeuds[iaux+jaux]]["Z"]
+-                vect.append(np.array((coox,cooy,cooz),np.float))
++                vect.append(np.array((coox,cooy,cooz),np.float32))
+             cosinus = np.dot(vect[1]-vect[0],vect[1]-vect[2])/(np.linalg.norm(vect[1]-vect[0])* np.linalg.norm(vect[1]-vect[2]))
+             #print ("cosinus = {}".format(cosinus))
+             # Si l'angle est plat, c'est que les 3 points sont alignés : on arrête... sauf si ce point est un départ d'une autre !
diff --git a/products/patches/SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch b/products/patches/SOLVERLAB-V9_12_0-numpy-1.20.-np.float.patch
new file mode 100644 (file)
index 0000000..cee329b
--- /dev/null
@@ -0,0 +1,26 @@
+diff --git a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html
+index a33c3d7..f738ac2 100644
+--- a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html
++++ b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.html
+@@ -12105,7 +12105,7 @@ A. Hannukainen, S. Korotov, M. Křı́žek, Maximum angle condition is not neces
+ <span class="c1">#Here are: Sparse matrix using scipy and vector using numpy </span>
+ <span class="c1">#==========================================================</span>
+ <span class="c1">#B = np.zeros(nbInteriorNodes)</span>
+-<span class="c1">#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float).toarray()</span>
++<span class="c1">#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float64).toarray()</span>
+ <span class="c1"># Vecteurs gradient de la fonction de forme associée à chaque noeud d&#39;un triangle (hypothèse 2D)</span>
+ <span class="n">GradShapeFunc0</span><span class="o">=</span><span class="n">cdmath</span><span class="o">.</span><span class="n">Vector</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="c1">#en 3D GradShapeFunc0=cdmath.Vector(3)</span>
+diff --git a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb
+index ad39e47..292bfd5 100644
+--- a/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb
++++ b/CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb
+@@ -291,7 +291,7 @@
+     "#Here are: Sparse matrix using scipy and vector using numpy \n",
+     "#==========================================================\n",
+     "#B = np.zeros(nbInteriorNodes)\n",
+-    "#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float).toarray()\n",
++    "#A = coo_matrix((nbInteriorNodes, nbInteriorNodes), dtype=np.float32).toarray()\n",
+     "\n",
+     "# Vecteurs gradient de la fonction de forme associée à chaque noeud d'un triangle (hypothèse 2D)\n",
+     "GradShapeFunc0=cdmath.Vector(3)#en 3D GradShapeFunc0=cdmath.Vector(3)\n",