From: abn Date: Wed, 20 Jan 2016 12:34:33 +0000 (+0100) Subject: API rename #1: preparing script and updating TODO X-Git-Tag: V8_0_0b1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=890ceca0a13478736942a95986f0bf7057c4fba3;p=tools%2Fmedcoupling.git API rename #1: preparing script and updating TODO --- diff --git a/v8_work/TODO.txt b/v8_work/TODO.txt index b12d49006..4e27a7ab3 100644 --- a/v8_work/TODO.txt +++ b/v8_work/TODO.txt @@ -105,6 +105,7 @@ DataArray DataArrayInt ------------ + isIdentity2 / isIota selectByTupleId2 / selectByTupleIdSlice BuildOld2NewArrayFromSurjectiveFormat2 / ConvertIndexArrayToO2N @@ -113,9 +114,9 @@ DataArrayInt getIdsEqualList / findIdsEqualList getIdsNotEqualList / findIdsNotEqualList getIdsEqualTuple / findIdsEqualTuple - locateValue(int) / findIdsFirstEqual - locateValue(vec) / findIdsFirstEqualList - search / findIdsSequence + locateValue / findIdFirstEqual + locateTuple / findIdFirstEqualTuple + search / findIdSequence getIdsInRange / findIdsInRange getIdsNotInRange / findIdsNotInRange getIdsStrictlyNegative / findIdsStricltyNegative diff --git a/v8_work/medcoup7to8.py b/v8_work/medcoup7to8.py index 9547ce562..9e8557d07 100755 --- a/v8_work/medcoup7to8.py +++ b/v8_work/medcoup7to8.py @@ -27,7 +27,7 @@ import argparse from optparse import OptionParser import os -DEFAULT_EXT = ['.hxx', '.cxx', '.txx', '.py', '.i', '.dox', '.rst', '.h', '.hh', '.hpp', '.c', '.cpp', ] +DEFAULT_EXT = ['.hxx', '.cxx', '.txx', '.py', '.i', '.dox', '.rst', '.h', '.hh', '.hpp', '.c', '.cpp'] ## The API changes: REPLACEMENTS = [("RevIntegral", "IntensiveConservation"), @@ -35,7 +35,65 @@ REPLACEMENTS = [("RevIntegral", "IntensiveConservation"), ("IntegralGlobConstraint", "ExtensiveConservation"), ("Integral", "ExtensiveMaximum"), ("MEDCouplingAutoRefCountObjectPtr", "MCAuto"), - ("deepCpy", "deepCopy") + ("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_ParaMEDMEM__MEDCouplingExtrudedMesh", "SWIGTYPE_p_ParaMEDMEM__MEDCouplingMappedExtrudedMesh"), + ("MEDCouplingExtrudedMesh____new___", "MEDCouplingMappedExtrudedMesh____new___"), + ("locateValue", "findIdFirstEqual"), + ("locateTuple", "findIdFirstEqualTuple"), + ("ParaMEDMEM_DataArrayByte_locateTuple", "ParaMEDMEM_DataArrayByte_findIdFirstEqualTuple"), + ("ParaMEDMEM_DataArrayAsciiChar_locateTuple", "ParaMEDMEM_DataArrayAsciiChar_findIdFirstEqualTuple"), + #("substr", "subArray"), # conflicts with regular C++ substr, to be handled manually + #("search", "findIdSequence"), # idem ] __myName = os.path.abspath(__file__) @@ -53,15 +111,18 @@ def convert(root_dir, ext, quiet): print "!!! Skipping script %s !!!" % __myName continue ok = False - for e in ext: - if fileName[-len(e):] == e: - ok = True - break + 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()) + line = re.sub("(\W|^)(%s)(\W|$)" % before, r"\1%s\3" % after, line.rstrip('\r\n')) print(line) # print in file parser = OptionParser()