SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i)
SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBRARIES} medcalculator)
SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
SET(MEDCouplingCorba_SWIG_DPYS_FILES
MEDCouplingCorbaTypemaps.i)
SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_DIRS}
SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
SET (MEDCoupling_SWIG_DPYS_FILES
MEDCouplingCommon.i
SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
# _ABR_ Ensure dependency mechanism on all SWIG files and headers
SET (SWIG_MODULE_MEDCouplingRemapper_EXTRA_DEPS ${MEDCoupling_SWIG_DPYS_FILES}
#endif
}
+ bool MEDCouplingHasSciPyBindings()
+ {
+#ifdef WITH_SCIPY
+ return true;
+#else
+ return false;
+#endif
+ }
+
std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
{
static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
self.assertAlmostEqual(0.3521445110626687 ,m[6][170],12)
pass
- @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
+ @unittest.skipUnless(MEDCouplingHasNumPyBindings() and MEDCouplingHasSciPyBindings(),"requires numpy AND scipy")
def testGetCrudeCSRMatrix1(self):
""" testing CSR matrix output using numpy/scipy.
"""
self.assertEqual(m_1.getnnz(),7)
pass
- @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
+ @unittest.skipUnless(MEDCouplingHasNumPyBindings() and MEDCouplingHasSciPyBindings(),"requires numpy AND scipy")
def testP0P1Bary_1(self):
a=MEDCouplingUMesh("a",2)
a.allocateCells()
SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDLoader_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDLoader_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
SET (MEDLoader_SWIG_DPYS_FILES
MEDLoaderCommon.i
SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
SET (ParaMEDMEM_SWIG_DPYS_FILES
ParaMEDMEM.typemap)
SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
INSTALL(TARGETS _ParaMEDMEM DESTINATION ${SALOME_INSTALL_PYTHON})
INSTALL(FILES ParaMEDMEM.i DESTINATION ${SALOME_INSTALL_HEADERS})
SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DWITH_NUMPY -DWITHOUT_AUTOFIELD)
-ELSE(NUMPY_FOUND)
- SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DWITHOUT_AUTOFIELD)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY};-DWITHOUT_AUTOFIELD")
IF(Boost_FOUND)
SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_BOOST ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})