From: Nabil Ghodbane Date: Mon, 17 Oct 2022 09:58:22 +0000 (+0200) Subject: MEDReader properties migration: FileName -> FileNames; AllArray-> FieldsStatus; AllTi... X-Git-Tag: V9_10_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fspns%2F32377%2Fparavis;p=modules%2Fparavis.git MEDReader properties migration: FileName -> FileNames; AllArray-> FieldsStatus; AllTimeSteps -> TimesFlagsStatus --- diff --git a/examples/command_line/medio.py b/examples/command_line/medio.py index 56a68bd8..884c60a2 100644 --- a/examples/command_line/medio.py +++ b/examples/command_line/medio.py @@ -26,7 +26,7 @@ def __select_data(reader, dataname=None): arr_name = [elt.split(separator)[0] for elt in arr_name_with_dis] for idx in range(len(keys)): if arr_name[idx] == dataname: - reader.AllArrays = keys[idx] + reader.FieldsStatus = keys[idx] break return reader @@ -35,22 +35,22 @@ def __select_data(reader, dataname=None): def get_element_type(reader): # Return 'P0', 'P1'... separator = reader.GetProperty("Separator").GetData() - return reader.AllArrays[0].split(separator)[1] + return reader.FieldsStatus[0].split(separator)[1] # def get_element_name(reader): separator = reader.GetProperty("Separator").GetData() - return reader.AllArrays[0].split(separator)[0].split("/")[-1] + return reader.FieldsStatus[0].split(separator)[0].split("/")[-1] # def load_mesh(med_filename, mesh_name=None): import pvsimple - reader = pvsimple.MEDReader(FileName=med_filename) + reader = pvsimple.MEDReader(FileNames=med_filename) return __select_data(reader, mesh_name) # def load_field(med_filename, field_name=None): import pvsimple - reader = pvsimple.MEDReader(FileName=med_filename) + reader = pvsimple.MEDReader(FileNames=med_filename) return __select_data(reader, field_name) # diff --git a/src/Plugins/DevelopedSurface/plugin/Test/test_dev_surface.py b/src/Plugins/DevelopedSurface/plugin/Test/test_dev_surface.py index 53d5f872..4e075582 100644 --- a/src/Plugins/DevelopedSurface/plugin/Test/test_dev_surface.py +++ b/src/Plugins/DevelopedSurface/plugin/Test/test_dev_surface.py @@ -24,9 +24,9 @@ from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() # create a new 'MED Reader' -multiTSmed = MEDReader(FileName='multiTS.med') -multiTSmed.AllArrays = ['TS0/Mesh/ComSup0/Pressure@@][@@P0'] -multiTSmed.AllTimeSteps = ['0000', '0001', '0002', '0003', '0004', '0005', '0006', '0007', '0008', '0009'] +multiTSmed = MEDReader(FileNames='multiTS.med') +multiTSmed.FieldsStatus = ['TS0/Mesh/ComSup0/Pressure@@][@@P0'] +multiTSmed.TimesFlagsStatus = ['0000', '0001', '0002', '0003', '0004', '0005', '0006', '0007', '0008', '0009'] # get animation scene animationScene1 = GetAnimationScene() diff --git a/src/Plugins/MEDReader/plugin/Doc/HowTo0.py b/src/Plugins/MEDReader/plugin/Doc/HowTo0.py index b5213bf1..81661b8c 100644 --- a/src/Plugins/MEDReader/plugin/Doc/HowTo0.py +++ b/src/Plugins/MEDReader/plugin/Doc/HowTo0.py @@ -1,6 +1,6 @@ from paraview.simple import * -myMedReader=MEDReader(FileName="/home/H87074/WORK/TESTS_AMA/TESTS0/ssll117a/ssll117a.med") +myMedReader=MEDReader(FileNames="/home/H87074/WORK/TESTS_AMA/TESTS0/ssll117a/ssll117a.med") # list of all keys diff --git a/src/Plugins/MEDReader/plugin/Test/TestDataAnalysis.py b/src/Plugins/MEDReader/plugin/Test/TestDataAnalysis.py index 9b73133b..6ea52cc8 100644 --- a/src/Plugins/MEDReader/plugin/Test/TestDataAnalysis.py +++ b/src/Plugins/MEDReader/plugin/Test/TestDataAnalysis.py @@ -44,8 +44,8 @@ print ("**** Importing MED file") myResult0 = MEDReader(FileNames=[MEDFILE]) if myResult0 is None : raise "Erreur de fichier MED" -# Imposition GenerateVectors à faire -myResult0.GenerateVectors=1 +# Imposition VectorsProperty à faire +myResult0.VectorsProperty=1 NB_ORDRE = myResult0.GetPropertyValue('TimestepValues') diff --git a/src/Plugins/MEDReader/plugin/Test/testMEDReader4.py b/src/Plugins/MEDReader/plugin/Test/testMEDReader4.py index 59da6cfd..e386c483 100644 --- a/src/Plugins/MEDReader/plugin/Test/testMEDReader4.py +++ b/src/Plugins/MEDReader/plugin/Test/testMEDReader4.py @@ -74,7 +74,7 @@ def test(baseline_file): testMEDReader4_med=MEDReader(FileNames=[fname]) testMEDReader4_med.FieldsStatus=['TS0/mesh/ComSup0/f0NoPfl@@][@@P1','TS0/mesh/ComSup0/mesh@@][@@P1'] - #testMEDReader4_med.AllTimeSteps=['0000'] + #testMEDReader4_med.TimesFlagsStatus=['0000'] Glyph1=Glyph(Input=testMEDReader4_med,GlyphType='Sphere') Glyph1.ScaleArray=['POINTS','No scale array']#f0NoPflN diff --git a/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter0.py b/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter0.py index 0947d5ac..04192e6e 100644 --- a/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter0.py +++ b/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter0.py @@ -49,9 +49,9 @@ with tempfile.TemporaryDirectory(prefix="MEDWriter_") as tmpdir: plane1 = Sphere() SaveData(fname0,proxy=plane1,WriteAllTimeSteps=1) # - totomed=MEDReader(FileName=fname0) - totomed.AllArrays=['TS1/Mesh/ComSup0/Mesh@@][@@P0'] - totomed.AllTimeSteps=['0000'] + totomed=MEDReader(FileNames=fname0) + totomed.FieldsStatus=['TS1/Mesh/ComSup0/Mesh@@][@@P0'] + totomed.TimesFlagsStatus=['0000'] SaveData(fname1,proxy=totomed,WriteAllTimeSteps=1) # Sphere has been written. Try to check to write it in MED file ! mfd=ml.MEDFileData(fname0) @@ -110,9 +110,9 @@ with tempfile.TemporaryDirectory(prefix="MEDWriter_") as tmpdir: f1ts1.setFieldNoProfileSBT(f0) f1ts1.write(fname2,0) # - test3=MEDReader(FileName=fname2) - test3.AllArrays=['TS0/%s/ComSup0/%s@@][@@P0'%(mName,fieldName0),'TS0/%s/ComSup0/%s@@][@@P1'%(mName,fieldName1)] - test3.AllTimeSteps = ['0000'] + test3=MEDReader(FileNames=fname2) + test3.FieldsStatus=['TS0/%s/ComSup0/%s@@][@@P0'%(mName,fieldName0),'TS0/%s/ComSup0/%s@@][@@P1'%(mName,fieldName1)] + test3.TimesFlagsStatus = ['0000'] SaveData(fname3,proxy=test3,WriteAllTimeSteps=1) ### test content of fname3 mfd2=ml.MEDFileData(fname3) diff --git a/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter1.py b/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter1.py index 9dced79b..efbcc49b 100644 --- a/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter1.py +++ b/src/Plugins/MEDWriter/plugin/Test/TestMEDWriter1.py @@ -84,7 +84,7 @@ with tempfile.TemporaryDirectory(prefix="MEDWriter_") as tmpdir: f1ts12n.setFieldNoProfileSBT(f1n) f1ts12n.write(fname_int64,0) - test12=MEDReader(FileName=fname_int64) + test12=MEDReader(FileNames=fname_int64) SaveData(fname_int64_exported, WriteAllTimeSteps=1) ### test content of fname_int64_exported mfd2=ml.MEDFileData(fname_int64_exported) diff --git a/src/Plugins/VoroGauss/plugin/Test/test_VoroGauss.py b/src/Plugins/VoroGauss/plugin/Test/test_VoroGauss.py index fcdeea09..175ea721 100644 --- a/src/Plugins/VoroGauss/plugin/Test/test_VoroGauss.py +++ b/src/Plugins/VoroGauss/plugin/Test/test_VoroGauss.py @@ -79,8 +79,8 @@ def test_geom(result, ref_mass_center, ref_volumes): # create a new 'MED Reader' file_name = os.path.join(data_dir, "testMEDReader14.med") testMEDReader14med = MEDReader(registrationName='testMEDReader14.med', - FileName=file_name) -testMEDReader14med.AllTimeSteps = ['0000', '0001', '0002', '0003', '0004'] + FileNames=file_name) +testMEDReader14med.TimesFlagsStatus = ['0000', '0001', '0002', '0003', '0004'] print("Testing {}".format(file_name)) fields = [(['zeField0'], @@ -112,7 +112,7 @@ fields = [(['zeField0'], ] for field_names, field, refs, center_mass, volume in fields: - testMEDReader14med.AllArrays = field + testMEDReader14med.FieldsStatus = field testMEDReader14med.UpdatePipeline() # create a new 'ELGA field To Surface' @@ -134,9 +134,9 @@ for field_names, field, refs, center_mass, volume in fields: ### # create a new 'MED Reader' file_name = os.path.join(data_dir, "PG_3D.med") -pG_3Dmed = MEDReader(registrationName='PG_3D.med', FileName=file_name) -pG_3Dmed.AllArrays = ['TS0/Extruded/ComSup0/Extruded@@][@@P0', - 'TS0/Extruded/ComSup0/MyFieldPG@@][@@GAUSS'] +pG_3Dmed = MEDReader(registrationName='PG_3D.med', FileNames=file_name) +pG_3Dmed.FieldsStatus = ['TS0/Extruded/ComSup0/Extruded@@][@@P0', + 'TS0/Extruded/ComSup0/MyFieldPG@@][@@GAUSS'] print("Testing {}".format(file_name)) pG_3Dmed.UpdatePipeline() @@ -219,10 +219,10 @@ f1.setArray(arr) WriteFieldUsingAlreadyWrittenMesh(fname,f1) # create a new 'MED Reader' -voroGauss1med = MEDReader(registrationName='VoroGauss1.med', FileName=fname) -voroGauss1med.AllArrays = ['TS0/mesh/ComSup0/MyFieldCell@@][@@P0', - 'TS0/mesh/ComSup0/MyFieldPG@@][@@GAUSS'] -voroGauss1med.AllTimeSteps = ['0000'] +voroGauss1med = MEDReader(registrationName='VoroGauss1.med', FileNames=fname) +voroGauss1med.FieldsStatus = ['TS0/mesh/ComSup0/MyFieldCell@@][@@P0', + 'TS0/mesh/ComSup0/MyFieldPG@@][@@GAUSS'] +voroGauss1med.TimesFlagsStatus = ['0000'] print("Testing {}".format(fname)) voroGauss1med.UpdatePipeline() @@ -356,10 +356,10 @@ fieldGauss2.checkConsistencyLight(); WriteFieldUsingAlreadyWrittenMesh(file_name, fieldGauss2) # create a new 'MED Reader' -simple_meshmed = MEDReader(registrationName='simple_mesh.med', FileName=file_name) -simple_meshmed.AllArrays = ['TS0/MESH/ComSup0/RESU____EPSI_NOEU@@][@@GAUSS', - 'TS0/MESH/ComSup0/RESU____SIGM_NOEU@@][@@GAUSS'] -simple_meshmed.AllTimeSteps = ['0000'] +simple_meshmed = MEDReader(registrationName='simple_mesh.med', FileNames=file_name) +simple_meshmed.FieldsStatus = ['TS0/MESH/ComSup0/RESU____EPSI_NOEU@@][@@GAUSS', + 'TS0/MESH/ComSup0/RESU____SIGM_NOEU@@][@@GAUSS'] +simple_meshmed.TimesFlagsStatus = ['0000'] print("Testing {}".format(file_name)) simple_meshmed.UpdatePipeline()