From 269a04a07a21caa7ade0bb6b93e84d6ece913bba Mon Sep 17 00:00:00 2001 From: Gbkng Date: Mon, 17 Jun 2024 20:17:28 +0200 Subject: [PATCH] remove v8_work --- CMakeLists.txt | 3 - v8_work/CMakeLists.txt | 24 ------ v8_work/ModifyNamespace.py | 59 -------------- v8_work/TODO.txt | 147 ----------------------------------- v8_work/medcoup7to8.py | 152 ------------------------------------- 5 files changed, 385 deletions(-) delete mode 100644 v8_work/CMakeLists.txt delete mode 100644 v8_work/ModifyNamespace.py delete mode 100644 v8_work/TODO.txt delete mode 100755 v8_work/medcoup7to8.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 840bac26a..5aa9fff2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,9 +299,6 @@ IF(MEDCOUPLING_BUILD_DOC) ENDIF(MEDCOUPLING_BUILD_DOC) ADD_SUBDIRECTORY(resources) -IF(MEDCOUPLING_ENABLE_PYTHON) - ADD_SUBDIRECTORY(v8_work) -ENDIF() # Configuration export # ==================== diff --git a/v8_work/CMakeLists.txt b/v8_work/CMakeLists.txt deleted file mode 100644 index 004374e6c..000000000 --- a/v8_work/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (C) 2012-2024 CEA, EDF -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -SET (_pyFile - medcoup7to8.py -) - -SALOME_INSTALL_SCRIPTS("${_pyFile}" ${MEDCOUPLING_INSTALL_SCRIPT_PYTHON}) diff --git a/v8_work/ModifyNamespace.py b/v8_work/ModifyNamespace.py deleted file mode 100644 index d7bee6798..000000000 --- a/v8_work/ModifyNamespace.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2016-2024 CEA, EDF -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -import os -rep=("namespace ParaMEDMEM","namespace MEDCoupling") -rep=("ParaMEDMEM::","MEDCoupling::") -#rep=("ParaMEDMEMImpl::","MEDCouplingImpl::") - -#rep=("_ParaMEDMEM__","_MEDCoupling__") -#rep=("ParaMEDMEM_","MEDCoupling_") -#rep=("ParaMEDMEMData","MEDCouplingData") - -#rep=("ParaMEDMEM_1","MEDCoupling_1") - -def rep0(fi,rep): - f=file(fi) ; lines=f.readlines() ; del f - lines2=[line.replace(*rep) for line in lines] - if lines2!=lines: - f=file(fi,"w") ; f.writelines(lines2) ; f.flush() - return 1 - else: - return 0 - -def rep1(dirname,rep): - i=0 - for fi in os.listdir(dirname): - fi2=os.path.join(dirname,fi) - if not os.path.isfile(fi2): - continue - i+=rep0(fi2,rep) - return i - -dirs=["MEDCoupling","MEDCoupling/Test","MEDLoader","MEDLoader/Swig","MEDLoader/Test","MEDPartitioner","MEDPartitioner/Test","MEDPartitioner_Swig","RENUMBER","RENUMBER_Swig","INTERP_KERNELTest","ParaMEDMEM","ParaMEDLoader","ParaMEDMEMTest","ParaMEDMEM_Swig","doc/user/doxygen/fakesources","doc/user/doxygen/doxy2swig","doc/user/doxygen/doxfiles","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba/Client","/home/H87074/salome/DEV/modules/src/MED/src/MEDCouplingCorba/Test","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalc/cmp","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator/Swig","/home/H87074/salome/DEV/modules/src/MED/src/MEDCalculator/Test","/home/H87074/salome/DEV/modules/src/PARAVIS/src/Plugins/MEDReader/IO"] -dirname=dirs[-1] -i=0 -print(rep1(dirname,rep)) -"""for r,dirs,fis in os.walk(dirname): - for fi in fis: - if os.path.splitext(fi)[1] not in [".dox",".doxy"]: - continue - i+=rep0(os.path.join(r,fi),rep) - -print i""" diff --git a/v8_work/TODO.txt b/v8_work/TODO.txt deleted file mode 100644 index 4e27a7ab3..000000000 --- a/v8_work/TODO.txt +++ /dev/null @@ -1,147 +0,0 @@ -TODO for V8 -%%%%%%%%%%% - -Covariance fixes [DONE] -================ - + MEDCouplingUMesh - deepCpy ! - deepCpyConnectivityOnly - mergeMyselfWithOnSameCoords - buildPartOfMySelf - buildPartOfMySelfNode - buildPartOfMySelf2 - buildFacePartOfMySelfNode - buildBoundaryMesh - buildPartOfMySelfKeepCoords - buildPartOfMySelfKeepCoords2 - - + MEDCouplingExtrudedMesh - deepCpy - + MEDCouplingIMesh - deepCpy - -Various simplifications [DONE] -======================= - + remove isIdentity2 - + remove replaceOneValByInThis (changeValue fait le meme boulot) - Attention repercuter if(oldValue==newValue) return 0 - + tessellate2D et tessellate2DCurve: à merger en un seul tessellate2D - + remove checkCoherency2 - -Inheritance fix (OK but at the end of process) -=============== - + move up in all classes deepCpy(), shallowCpy(), clone() - -Namespace changes [DONE] -================= - + MEDCoupling for all - + MEDLoader static methods moved at namespace level - . C++ modifications - . Removal of the MEDLoader Python module - -Renaming -======== - + write script to do it! - + apply following renamings - -Interpolation -------------- - RevIntegral / IntensiveConservation - ConservativeVolumic / IntensiveMaximum - IntegralGlobConstraint / ExtensiveConservation - Integral / ExtensiveMaximum - -All classes ------------ - deepCpy / deepCopy - performCpy / performCopyOrIncrRef - -Auto-pointeur -------------- - MEDCouplingAutoRefCountObjectPtr / MCAuto - -MEDCouplingExtrudedMesh ------------------------ - MEDCouplingExtrudedMesh / MEDCouplingMappedExtrudedMesh - -MEDCouplingMesh ---------------- - getBarycenterAndOwner / computeCellCenterOfMass - checkCoherency / checkConsistencyLight - checkCoherency1 / checkConsistency - -MEDCouplingPointSet -------------------- - mergeNodes2 / mergeNodesCenter - renumberNodes2 / renumberNodesCenter - buildPartOfMySelf2 / buildPartOfMySelfSlice - buildPartOfMySelfKeepCoords2 / buildPartOfMySelfKeepCoordsSlice - deepCpyConnectivityOnly / deepCopyConnectivityOnly - -MEDCoupling1DGTUMesh --------------------- - checkCoherencyOfConnectivity / checkConsistencyOfConnectivity - -MEDCouplingUMesh ----------------- - getMeshLength / getNodalConnectivityArrayLen - AreCellsEqual0 / AreCellsEqualPolicy0 - AreCellsEqual1 / AreCellsEqualPolicy1 - AreCellsEqual2 / AreCellsEqualPolicy2 - AreCellsEqual7 / AreCellsEqualPolicy7 - AreCellsEqual3 / AreCellsEqualPolicy2NoType - areCellsIncludedIn2 / areCellsIncludedInPolicy7 - setPartOfMySelf2 / setPartOfMySelfSlice - ExtractFromIndexedArrays2 / ExtractFromIndexedArraysSlice - SetPartOfIndexedArrays2 / SetPartOfIndexedArraysSlice - SetPartOfIndexedArraysSameIdx2 / SetPartOfIndexedArraysSameIdxSlice - deepCpyConnectivityOnly / deepCopyConnectivityOnly - -DataArray ---------- - setContigPartOfSelectedValues2 / setContigPartOfSelectedValuesSlice - selectByTupleId2 / selectByTupleIdSafe - GetAxTypeRepr / GetAxisTypeRepr - cpyFrom / deepCopyFrom - -DataArrayInt ------------- - isIdentity2 / isIota - selectByTupleId2 / selectByTupleIdSlice - BuildOld2NewArrayFromSurjectiveFormat2 / ConvertIndexArrayToO2N - - getIdsEqual / findIdsEqual - getIdsNotEqual / findIdsNotEqual - getIdsEqualList / findIdsEqualList - getIdsNotEqualList / findIdsNotEqualList - getIdsEqualTuple / findIdsEqualTuple - locateValue / findIdFirstEqual - locateTuple / findIdFirstEqualTuple - search / findIdSequence - getIdsInRange / findIdsInRange - getIdsNotInRange / findIdsNotInRange - getIdsStrictlyNegative / findIdsStricltyNegative - searchRangesInListOfIds / findIdsRangesInListOfIds - - computeOffsets2 / computeOffsetsFull - -DataArrayDouble ---------------- - substr / subArray - applyFunc2 / applyFuncCompo - applyFunc3 / applyFuncNamedCompo - -MEDCouplingFieldDouble ----------------------- - getIdsInRange / findIdsInRange - fillFromAnalytic2 / fillFromAnalyticCompo - fillFromAnalytic3 / fillFromAnalyticNamedCompo - applyFunc2 / applyFuncCompo - applyFunc3 / applyFuncNamedCompo - mergeNodes2 / mergeNodesCenter - -MEDFileMesh ------------ - setAxType / setAxisType - getAxType / getAxisType - - diff --git a/v8_work/medcoup7to8.py b/v8_work/medcoup7to8.py deleted file mode 100755 index 95e65c280..000000000 --- a/v8_work/medcoup7to8.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env python -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2024 CEA, EDF -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# Author : Adrien BRUNETON (CEA/DEN) - -import fileinput -import re, os -import argparse - -from optparse import OptionParser -import os - -DEFAULT_EXT = ['.hxx', '.cxx', '.txx', '.py', '.i', '.dox', '.rst', '.h', '.hh', '.hpp', '.c', '.cpp'] - -## The API changes: -REPLACEMENTS = [("RevIntegral", "IntensiveConservation"), - ("ConservativeVolumic", "IntensiveMaximum"), - ("IntegralGlobConstraint", "ExtensiveConservation"), - ("Integral", "ExtensiveMaximum"), - ("MEDCouplingAutoRefCountObjectPtr", "MCAuto"), - ("deepCpy", "deepCopy"), - ("performCpy", "performCopyOrIncrRef"), - ("MEDCouplingExtrudedMesh", "MEDCouplingMappedExtrudedMesh"), - ("getBarycenterAndOwner", "computeCellCenterOfMass"), - ("checkCoherency", "checkConsistencyLight"), - ("checkCoherency1", "checkConsistency"), - ("mergeNodes2", "mergeNodesCenter"), - ("renumberNodes2", "renumberNodesCenter"), - ("buildPartOfMySelf2", "buildPartOfMySelfSlice"), - ("buildPartOfMySelfKeepCoords2", "buildPartOfMySelfKeepCoordsSlice"), - ("deepCpyConnectivityOnly", "deepCopyConnectivityOnly"), - ("checkCoherencyOfConnectivity", "checkConsistencyOfConnectivity"), - ("getMeshLength", "getNodalConnectivityArrayLen"), - ("AreCellsEqual0", "AreCellsEqualPolicy0"), - ("AreCellsEqual1", "AreCellsEqualPolicy1"), - ("AreCellsEqual2", "AreCellsEqualPolicy2"), - ("AreCellsEqual7", "AreCellsEqualPolicy7"), - ("AreCellsEqual3", "AreCellsEqualPolicy2NoType"), - ("areCellsIncludedIn2", "areCellsIncludedInPolicy7"), - ("setPartOfMySelf2", "setPartOfMySelfSlice"), - ("ExtractFromIndexedArrays2", "ExtractFromIndexedArraysSlice"), - ("SetPartOfIndexedArrays2", "SetPartOfIndexedArraysSlice"), - ("SetPartOfIndexedArraysSameIdx2", "SetPartOfIndexedArraysSameIdxSlice"), - ("deepCpyConnectivityOnly", "deepCopyConnectivityOnly"), - ("setContigPartOfSelectedValues2", "setContigPartOfSelectedValuesSlice"), - ("selectByTupleId2", "selectByTupleIdSafeSlice"), - ("GetAxTypeRepr", "GetAxisTypeRepr"), - ("cpyFrom", "deepCopyFrom"), - ("selectByTupleId2", "selectByTupleIdSlice"), - ("BuildOld2NewArrayFromSurjectiveFormat2", "ConvertIndexArrayToO2N"), - ("getIdsEqual", "findIdsEqual"), - ("getIdsNotEqual", "findIdsNotEqual"), - ("getIdsEqualList", "findIdsEqualList"), - ("getIdsNotEqualList", "findIdsNotEqualList"), - ("getIdsEqualTuple", "findIdsEqualTuple"), - ("getIdsInRange", "findIdsInRange"), - ("getIdsNotInRange", "findIdsNotInRange"), - ("getIdsStrictlyNegative", "findIdsStricltyNegative"), - ("searchRangesInListOfIds", "findIdsRangesInListOfIds"), - ("computeOffsets2", "computeOffsetsFull"), - ("applyFunc2", "applyFuncCompo"), - ("applyFunc3", "applyFuncNamedCompo"), - ("getIdsInRange", "findIdsInRange"), - ("fillFromAnalytic2", "fillFromAnalyticCompo"), - ("fillFromAnalytic3", "fillFromAnalyticNamedCompo"), - ("applyFunc2", "applyFuncCompo"), - ("applyFunc3", "applyFuncNamedCompo"), - ("mergeNodes2", "mergeNodesCenter"), - ("setAxType", "setAxisType"), - ("getAxType", "getAxisType"), - ("isIdentity2", "isIota"), - ("SWIGTYPE_p_MEDCoupling__MEDCouplingExtrudedMesh", "SWIGTYPE_p_MEDCoupling__MEDCouplingMappedExtrudedMesh"), - ("MEDCouplingExtrudedMesh____new___", "MEDCouplingMappedExtrudedMesh____new___"), - ("locateValue", "findIdFirstEqual"), - ("locateTuple", "findIdFirstEqualTuple"), - ("MEDCoupling_DataArrayByte_locateTuple", "MEDCoupling_DataArrayByte_findIdFirstEqualTuple"), - ("MEDCoupling_DataArrayAsciiChar_locateTuple", "MEDCoupling_DataArrayAsciiChar_findIdFirstEqualTuple"), - #("substr", "subArray"), # conflicts with regular C++ substr, to be handled manually - #("search", "findIdSequence"), # idem - ] - -__myName = os.path.abspath(__file__) - -def convert(root_dir, ext, quiet): - if not os.path.isdir(root_dir): - raise ValueError("%s is not a valid directory!" % root_dir) - - for root, _, fNames in os.walk(root_dir, followlinks=False): - for fName in fNames: - fileName = os.path.join(root, fName) - # Skip this script! - if fileName == __myName: - if not quiet: - print("!!! Skipping script %s !!!" % __myName) - continue - ok = False - if fileName[-28:] != "MEDCouplingNatureOfFieldEnum": - for e in ext: - if fileName[-len(e):] == e: - ok = True - break - else: - ok = True - if not ok: continue # skip file - if not quiet: print("Handling %s ..." % fileName) - for line in fileinput.input(fileName, inplace=1, backup='.bak'): - for before, after in REPLACEMENTS: - line = re.sub("(\W|^)(%s)(\W|$)" % before, r"\1%s\3" % after, line.rstrip('\r\n')) - print(line) # print in file - -parser = OptionParser() -parser.set_usage("Automatic code renaming, corresponding to the API changes between version 7x and 8x of MEDCoupling.\n" - "Original files are backup adding '.bak' to the original name.\n" - "On Linux file systems, links are not followed!\n\n" - " %prog [options] root_directory") -ext_disp = ",".join(DEFAULT_EXT) -parser.add_option("-e", "--extension", dest="extension", default="", metavar="EXTENSIONS", - help="Comma separated list of handled extensions (default is %s)" % ext_disp) -parser.add_option("-q", "--quiet", - action="store_false", dest="verbose", default=True, - help="Don't print status messages to stdout") -(opts, args) = parser.parse_args() - -if len(args) != 1: - parser.print_usage() - exit(1) - -if opts.extension != "": - ext = [s.strip() for s in opts.extension.split(",")] -else: - ext = DEFAULT_EXT - -dirName = os.path.abspath(args[0]) -convert(dirName, ext, not opts.verbose) - -- 2.39.2