Salome HOME
Merge changes from 'master' branch.
authorrnv <rnv@opencascade.com>
Fri, 29 Dec 2017 13:21:20 +0000 (16:21 +0300)
committerrnv <rnv@opencascade.com>
Fri, 29 Dec 2017 13:21:20 +0000 (16:21 +0300)
1  2 
src/tests/Test/test_1.py
src/tests/Test/test_2.py
src/tests/Test/test_3.py
src/tests/Test/test_4.py
src/tests/Test/test_5.py
src/tests/Test/tutorial_1.py
src/tests/Test/tutorial_2.py
src/tests/Test/tutorial_3.py
src/tests/Test/tutorial_4.py
src/tests/Test/tutorial_5.py

diff --combined src/tests/Test/test_1.py
index f9fe63ac54e0be8398569e22b870920381d5968d,dd221ebc8816a4fcb94ddfaa1cd899004d7e7074..9690918fe9e0e9f9bee9de6c97267c2134437ea2
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test test_1
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "test_1"
@@@ -62,7 -62,7 +62,7 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
@@@ -70,7 -70,7 +70,7 @@@
  #
    while not error :
    #
 -    HOMARD.SetCurrentStudy(theStudy)
 +    HOMARD.UpdateStudy()
    #
    # Creation of the zones
    # =====================
      zones_1_et_2.AddZone('Zone_1_1', 1)
      zones_1_et_2.AddZone('Zone_1_2', 1)
      laux = zones_1_et_2.GetZones()
 -    nbzone = len(laux)/2
 +    nbzone = len(laux) // 2
      jaux = 0
-     for _ in range(nbzone) :
+     for iaux in range(nbzone) :
        print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
        jaux += 2
      print(hyponame_2, " : champ utilisé :", zones_1_et_2.GetFieldName())
@@@ -202,11 -202,11 +202,11 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
-   raise Exception('Pb in homard_exec: ' + str(eee))
 -  raise Exception('Pb in homard_exec: '+eee.message)
++  raise Exception('Pb in homard_exec: '+str(eee.message))
  #
  # Test of the results
  #
@@@ -215,6 -215,6 +215,6 @@@ DESTROY_DIR = not DEBU
  test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
diff --combined src/tests/Test/test_2.py
index 12273aa594a339d5043427751f084c96dac86117,c73f71fa05f519533d1e78445c2d9385f8c481b6..f4f58a2189c3c26c1c0c1d1ff386186d34b7cd97
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test test_2
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "test_2"
@@@ -62,7 -62,7 +62,7 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
@@@ -70,7 -70,7 +70,7 @@@
  #
    while not error :
    #
 -    HOMARD.SetCurrentStudy(theStudy)
 +    HOMARD.UpdateStudy()
    #
    # Creation of the boundaries
    # ==========================
@@@ -174,7 -174,7 +174,7 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
@@@ -187,6 -187,6 +187,6 @@@ DESTROY_DIR = not DEBU
  test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
diff --combined src/tests/Test/test_3.py
index 6c9b3dc63b67101ac36cf8f4407839f2dd3d816a,04dbec62269a641c4e93217175a7dce91355b5f5..cb324205722acdfedfb622482b40c99ce006f124
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test test_3
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "test_3"
@@@ -63,7 -63,7 +63,7 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
@@@ -71,7 -71,7 +71,7 @@@
  #
    while not error :
    #
 -    HOMARD.SetCurrentStudy(theStudy)
 +    HOMARD.UpdateStudy()
    #
    # Creation of the boundaries
    # ==========================
@@@ -208,7 -208,7 +208,7 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
@@@ -221,6 -221,6 +221,6 @@@ DESTROY_DIR = not DEBU
  test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
diff --combined src/tests/Test/test_4.py
index 971c73e71bfd9241f506ffb5efec6d4f35044ca1,c3d870c24dea815057f53d86caf5c6d39fe34f12..6a83c6f8e1bd60aa7dd1a724e63f6ce32907790f
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test test_4
  """
- __revision__ = "V2.2"
+ __revision__ = "V3.01"
  
  #========================================================================
  TEST_NAME = "test_4"
@@@ -78,7 -78,7 +78,7 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def geom_smesh_exec(theStudy):
 +def geom_smesh_exec():
    """
  Python script for GEOM and SMESH
    """
@@@ -86,7 -86,7 +86,7 @@@
  #
    while not error :
    #
 -    geompy = geomBuilder.New(theStudy)
 +    geompy = geomBuilder.New()
    #
    # Creation of the box
    # ===================
@@@ -94,7 -94,7 +94,7 @@@
  
    # Creation of the mesh
    # ====================
 -    smesh = smeshBuilder.New(theStudy)
 +    smesh = smeshBuilder.New()
      box_m = smesh.Mesh(box_g)
      smesh.SetName(box_m.GetMesh(), 'MESH')
    #
    #
      try:
        ficmed = os.path.join(DIRCASE, 'maill.00.med')
 -      box_m.ExportMED( ficmed, 0, SMESH.MED_V2_2, 1, None, 1)
 +      box_m.ExportMED(ficmed)
      except Exception as eee:
        error = 2
 -      raise Exception('ExportToMEDX() failed. '+eee.message)
 +      raise Exception('ExportMED() failed. ' + str(eee))
    #
      break
    #
  #========================================================================
  #
  #========================================================================
 -def field_exec(theStudy, niter):
 +def field_exec(niter):
    """
  Python script for MEDCoupling
    """
  
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
  #
    while not error :
    #
 -    HOMARD.SetCurrentStudy(theStudy)
 +    HOMARD.UpdateStudy()
    #
    # Creation of the zones
    # =====================
      hypo_4_1.AddZone('Zone_4_1', 1)
      hypo_4_1.SetExtraOutput(2)
      laux = hypo_4_1.GetZones()
 -    nbzone = len(laux)/2
 +    nbzone = len(laux) // 2
      jaux = 0
      for iaux in range(nbzone) :
        print(hyponame_1, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
      hypo_4_2.AddZone('Zone_4_2', 1)
      hypo_4_2.SetExtraOutput(2)
      laux = hypo_4_2.GetZones()
 -    nbzone = len(laux)/2
 +    nbzone = len(laux) // 2
      jaux = 0
      for iaux in range(nbzone) :
        print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
  
    # Creation of the iteration 3
    #
 -    error = field_exec(theStudy, 2)
 +    error = field_exec(2)
      if error :
        error = 30
        break
  # Geometry and Mesh
  #
  try :
 -  ERROR = geom_smesh_exec(salome.myStudy)
 +  ERROR = geom_smesh_exec()
    if ERROR :
      raise Exception('Pb in geom_smesh_exec')
  except Exception as eee:
-   raise Exception('Pb in geom_smesh_exec: ' + str(eee))
 -  raise Exception('Pb in geom_smesh_exec: '+eee.message)
++  raise Exception('Pb in geom_smesh_exec: '+str(eee.message))
  
  HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
  assert HOMARD is not None, "Impossible to load homard engine"
@@@ -330,11 -330,11 +330,11 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
-   raise Exception('Pb in homard_exec: ' + str(eee))
 -  raise Exception('Pb in homard_exec: '+eee.message)
++  raise Exception('Pb in homard_exec: '+str(eee.message))
  #
  # Test of the results
  #
@@@ -343,6 -343,6 +343,6 @@@ DESTROY_DIR = not DEBU
  test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
diff --combined src/tests/Test/test_5.py
index 30fe52b8354afd668e61931979331eba208d7d64,1c131ce30f8228857cf7474aa2b32066b10d631a..439426c02ef8b994aa0f19c1aa8fd115cc1fc963
@@@ -22,7 -22,7 +22,7 @@@ Python script for HOMAR
  Specific conditions for Code_Saturne
  Test test_5
  """
- __revision__ = "V1.0"
+ __revision__ = "V2.01"
  
  #========================================================================
  TEST_NAME = "test_5"
@@@ -77,7 -77,7 +77,7 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def mesh_exec(theStudy):
 +def mesh_exec():
    """
  Python script for MED
    """
        meshMEDFile3D.write(ficmed, 2)
      except Exception as eee:
        error = 2
 -      raise Exception('ExportToMEDX() failed. '+eee.message)
 +      raise Exception('MEDFileUMesh.write() failed. ' + str(eee))
    #
      break
    #
  #========================================================================
  #
  #========================================================================
 -def field_exec(theStudy, niter):
 +def field_exec(niter):
    """
  Python script for MEDCoupling
    """
  
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
  #
    while not error :
    #
 -    HOMARD.SetCurrentStudy(theStudy)
 +    HOMARD.UpdateStudy()
    #
    # Creation of the hypothese DISTANCE INVERSE
    # ==========================================
      #
      # Creation of the indicator
      #
 -      error, ficmed_indic = field_exec(theStudy, niter)
 +      error, ficmed_indic = field_exec(niter)
        if error :
          error = 10
          break
  # Geometry and Mesh
  #
  try :
 -  ERROR = mesh_exec(salome.myStudy)
 +  ERROR = mesh_exec()
    if ERROR :
      raise Exception('Pb in mesh_exec')
  except Exception as eee:
-   raise Exception('Pb in mesh_exec: ' + str(eee))
 -  raise Exception('Pb in mesh_exec: '+eee.message)
++  raise Exception('Pb in mesh_exec: '+str(eee.message))
  
  HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
  assert HOMARD is not None, "Impossible to load homard engine"
@@@ -318,11 -318,11 +318,11 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
-   raise Exception('Pb in homard_exec: ' + str(eee))
 -  raise Exception('Pb in homard_exec: '+eee.message)
++  raise Exception('Pb in homard_exec: '+str(eee.message))
  #
  # Test of the results
  #
@@@ -331,6 -331,6 +331,6 @@@ DESTROY_DIR = not DEBU
  test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
index 06566b9b9d9d3f845432c6bb94c1e32da5b2d674,b227bd2aba1bf6729694a831689b040bdf2bb48f..96a3868a970a8658e09f62034a8548b047625ee0
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test tutorial_1 associe au tutorial 1
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "tutorial_1"
@@@ -69,12 -69,12 +69,12 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
    #
 -  homard.SetCurrentStudy(theStudy)
 +  homard.UpdateStudy()
    #
    # Hypotheses
    # ==========
@@@ -120,7 -120,7 +120,7 @@@ homard.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
@@@ -137,6 -137,6 +137,6 @@@ gzip_gunzip(DATA_TUTORIAL, 1, 1
  # ==================================
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
index 58c456dcd50b8f8e613ae7ad9dba3ecfaf5095e9,ca731ac5cc17f648e40c370563e38bbf82f16817..585523c117eb64916232836df192a7e79fc2decc
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test tutorial_2 associe au tutorial 2
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "tutorial_2"
@@@ -69,12 -69,12 +69,12 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
    #
 -  HOMARD.SetCurrentStudy(theStudy)
 +  HOMARD.UpdateStudy()
    #
    # Creation des zones
    # ==================
@@@ -131,7 -131,7 +131,7 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
@@@ -148,6 -148,6 +148,6 @@@ gzip_gunzip(DATA_TUTORIAL, 2, 1
  # ==================================
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
index d982d9b4a1081da893ca585ce6799b2d9dbdbf76,c4efe620b192392d47444b2cfc04920b0e372729..d9b843715087a5b55de52a002d80581f77c1da0e
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test tutorial_3 associe au tutorial 3
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "tutorial_3"
@@@ -69,12 -69,12 +69,12 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
    #
 -  HOMARD.SetCurrentStudy(theStudy)
 +  HOMARD.UpdateStudy()
    #
    # Hypothese "hypo_0vers1"
    # =======================
@@@ -160,7 -160,7 +160,7 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
@@@ -177,6 -177,6 +177,6 @@@ gzip_gunzip(DATA_TUTORIAL, 3, 1
  # ==================================
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
index 8d22a0ea75c58b2fc02ce342276deb0146ad3925,3816780d7a7463eebfc0ca1089817dd05869e22b..1853abe37ebe0de6ac537196adb8f553c9cc4a71
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test tutorial_4 associe au tutorial 4
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "tutorial_4"
@@@ -69,12 -69,12 +69,12 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
    #
 -  HOMARD.SetCurrentStudy(theStudy)
 +  HOMARD.UpdateStudy()
  #
    # Frontieres
    # ==========
@@@ -147,7 -147,7 +147,7 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
@@@ -164,6 -164,6 +164,6 @@@ gzip_gunzip(DATA_TUTORIAL, 4, 1
  # ==================================
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)
  
index 784b9a41f31cb49d44020aee07cd69e5d6d35742,1ffd27205d3d8ef20a3bc9ed840afc041e4e93eb..00234d92fb2d8ff8ef17af2d77a0a0b754ae903a
@@@ -21,7 -21,7 +21,7 @@@
  Python script for HOMARD
  Test tutorial_5 associe au tutorial 5
  """
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
  
  #========================================================================
  TEST_NAME = "tutorial_5"
@@@ -69,12 -69,12 +69,12 @@@ IPAR.append("AP_MODULES_LIST", "Homard"
  #
  #========================================================================
  #========================================================================
 -def homard_exec(theStudy):
 +def homard_exec():
    """
  Python script for HOMARD
    """
    #
 -  HOMARD.SetCurrentStudy(theStudy)
 +  HOMARD.UpdateStudy()
  #
    # Frontiere
    # =========
@@@ -131,7 -131,7 +131,7 @@@ HOMARD.SetLanguageShort("fr"
  # Exec of HOMARD-SALOME
  #
  try :
 -  ERROR = homard_exec(salome.myStudy)
 +  ERROR = homard_exec()
    if ERROR :
      raise Exception('Pb in homard_exec at iteration %d' %ERROR )
  except Exception as eee:
@@@ -148,6 -148,6 +148,6 @@@ gzip_gunzip(DATA_TUTORIAL, 5, 1
  # ==================================
  #
  if salome.sg.hasDesktop():
 -  salome.sg.updateObjBrowser(True)
 +  salome.sg.updateObjBrowser()
    iparameters.getSession().restoreVisualState(1)