From: Anthony Geay Date: Tue, 27 Aug 2024 12:32:05 +0000 (+0200) Subject: [EDF30822] : Finalisation of integration of iterative statistics X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7806b6638b6c8e1978cc8371f1c55ccd9e723f59;p=tools%2Fmedcoupling.git [EDF30822] : Finalisation of integration of iterative statistics --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4b5848813..14229c770 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,12 +33,14 @@ ADD_SUBDIRECTORY(ICoCo) IF(MEDCOUPLING_ENABLE_PYTHON) ADD_SUBDIRECTORY(MEDCoupling_Swig) - ADD_SUBDIRECTORY(PyWrapping) - + find_package(SalomeBasicIterativeStatistics) if( BASICITERATIVESTATISTICS_FOUND ) - add_subdirectory(Stat) + add_subdirectory(Stat) endif( BASICITERATIVESTATISTICS_FOUND ) + + ADD_SUBDIRECTORY(PyWrapping) + ENDIF(MEDCOUPLING_ENABLE_PYTHON) IF(NOT MEDCOUPLING_MICROMED) diff --git a/src/PyWrapping/CMakeLists.txt b/src/PyWrapping/CMakeLists.txt index 43340d095..642ce08f5 100644 --- a/src/PyWrapping/CMakeLists.txt +++ b/src/PyWrapping/CMakeLists.txt @@ -95,6 +95,10 @@ IF(MEDCOUPLING_USE_MPI) LIST(APPEND medcoupling_LIB_dependancies paramedmem) ENDIF(MEDCOUPLING_USE_MPI) +if(BASICITERATIVESTATISTICS_FOUND) + LIST(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS -DWITH_ITERATIVE_STATISTICS) +endif(BASICITERATIVESTATISTICS_FOUND) + IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(medcoupling python medcoupling.i) ELSE() diff --git a/src/PyWrapping/medcoupling.i b/src/PyWrapping/medcoupling.i index 06c12759c..4e9436cae 100644 --- a/src/PyWrapping/medcoupling.i +++ b/src/PyWrapping/medcoupling.i @@ -57,8 +57,9 @@ static const char RENUM_EXT[]="Renumberer"; static const char PART_EXT[]="Partitioner"; static const char PAR_INTERPOL_EXT[]="Parallel interpolator (SPMD paradigm)"; + static const char IT_STATS_EXT[] = "Iterative statistics"; - static const char *EXTENSIONS[]={SEQ_INTERPOL_EXT,MEDFILEIO_EXT,RENUM_EXT,PART_EXT,PAR_INTERPOL_EXT}; + static const char *EXTENSIONS[]={SEQ_INTERPOL_EXT,MEDFILEIO_EXT,RENUM_EXT,PART_EXT,PAR_INTERPOL_EXT,IT_STATS_EXT}; static const int NB_OF_EXTENSIONS=sizeof(EXTENSIONS)/sizeof(const char *); %} @@ -148,6 +149,9 @@ #endif #ifdef WITH_PARALLEL_INTERPOLATOR ret.push_back(std::string(PAR_INTERPOL_EXT)); +#endif +#ifdef WITH_ITERATIVE_STATISTICS + ret.push_back(std::string(IT_STATS_EXT)); #endif return ret; } diff --git a/src/PyWrapping/medcoupling_pycode b/src/PyWrapping/medcoupling_pycode index be8527b8e..728e536d5 100644 --- a/src/PyWrapping/medcoupling_pycode +++ b/src/PyWrapping/medcoupling_pycode @@ -53,14 +53,6 @@ def AdvancedExtensionsStr(sz=60): SubExtension(MEDPartitioner.AllAlgorithms(),MEDPartitioner.AvailableAlgorithms(),pad,tab, sts) pass pass - - try: - import iterative_stats - isOK = 1 - except ImportError: - isOk = 0 - sts.append(f"Iterative statistics {tab[isOK].rjust(3):.>{sz-21}}") - return "\n".join(sts) def ShowAdvancedExtensions(sz=60):