Salome HOME
Updating copyright date information
[modules/adao.git] / src / daComposant / daCore / Interfaces.py
index 0b6fbf891a88a7d8d09ea073e59408e6441d6ca8..bc25f135c1215f1f983e07d53c41fc5272e6661f 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008-2021 EDF R&D
+# Copyright (C) 2008-2022 EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -66,7 +66,7 @@ class GenericCaseViewer(object):
         if __hasNotExecute:
             self._lineSerie.append("%s.execute()"%(self._objname,))
         if __upa is not None and len(__upa)>0:
-            __upa = __upa.replace("ADD.",str(self._objname)+".")
+            __upa = __upa.replace("ADD",str(self._objname))
             self._lineSerie.append(__upa)
     def _addLine(self, line=""):
         "Ajoute un enregistrement individuel"
@@ -132,7 +132,7 @@ class _TUIViewer(GenericCaseViewer):
                 if   k == "ColMajor"             and not __v: continue
                 if   k == "InputFunctionAsMulti" and not __v: continue
                 if   k == "nextStep"             and not __v: continue
-                if   k == "AvoidRC"              and     __v: continue
+                if   k == "PerformanceProfile"   and     __v: continue
                 if   k == "noDetails":                        continue
                 if isinstance(__v,Persistence.Persistence): __v = __v.values()
                 if callable(__v): __text = self._missing%__v.__name__+__text
@@ -183,6 +183,8 @@ class _COMViewer(GenericCaseViewer):
         "Transformation d'enregistrement(s) en commande(s) individuelle(s)"
         __suppparameters = {}
         if __multilines is not None:
+            if 'adaoBuilder' in __multilines:
+                raise ValueError("Impossible to load given content as an ADAO COMM one (Hint: it's perhaps not a COMM input, but a TUI one).")
             if "ASSIMILATION_STUDY" in __multilines:
                 __suppparameters.update({'StudyType':"ASSIMILATION_STUDY"})
                 __multilines = __multilines.replace("ASSIMILATION_STUDY","dict")
@@ -231,7 +233,7 @@ class _COMViewer(GenericCaseViewer):
             #
             elif __command == "UserPostAnalysis" and type(r) is dict:
                 if 'STRING' in r:
-                    __UserPostAnalysis = r['STRING'].replace("ADD.",str(self._objname)+".")
+                    __UserPostAnalysis = r['STRING'].replace("ADD",str(self._objname))
                     __commands.append( "set( Concept='UserPostAnalysis', String=\"\"\"%s\"\"\" )"%(__UserPostAnalysis,) )
                 elif 'SCRIPT_FILE' in r and os.path.exists(r['SCRIPT_FILE']):
                     __UserPostAnalysis = open(r['SCRIPT_FILE'],'r').read()
@@ -489,7 +491,7 @@ class _SCDViewer(GenericCaseViewer):
                 elif __k in ('Stored', 'Checked', 'ColMajor', 'InputFunctionAsMulti', 'nextStep'):
                     if bool(__v):
                         __text += "%s_config['%s'] = '%s'\n"%(__command,__k,int(bool(__v)))
-                elif __k in ('AvoidRC', 'noDetails'):
+                elif __k in ('PerformanceProfile', 'noDetails'):
                     if not bool(__v):
                         __text += "%s_config['%s'] = '%s'\n"%(__command,__k,int(bool(__v)))
                 else:
@@ -520,7 +522,7 @@ class _SCDViewer(GenericCaseViewer):
             self._addLine("Analysis_config = {}")
             self._addLine("Analysis_config['From'] = 'String'")
             self._addLine("Analysis_config['Data'] = \"\"\"import numpy")
-            self._addLine("xa=numpy.ravel(ADD.get('Analysis')[-1])")
+            self._addLine("xa=ADD.get('Analysis')[-1]")
             self._addLine("print('Analysis:',xa)\"\"\"")
             self._addLine("study_config['UserPostAnalysis'] = Analysis_config")
     def __loadVariablesByScript(self):
@@ -644,13 +646,13 @@ class _ReportViewer(GenericCaseViewer):
                 if   k == "ColMajor"             and not __v: continue
                 if   k == "InputFunctionAsMulti" and not __v: continue
                 if   k == "nextStep"             and not __v: continue
-                if   k == "AvoidRC"              and     __v: continue
+                if   k == "PerformanceProfile"   and     __v: continue
                 if   k == "noDetails":                        continue
                 if   k == "Concept":                          continue
                 if   k == "self":                             continue
                 if isinstance(__v,Persistence.Persistence): __v = __v.values()
                 numpy.set_printoptions(precision=15,threshold=1000000,linewidth=1000*15)
-                __ktext += "\n        %s=%s, "%(k,repr(__v))
+                __ktext += "\n        %s = %s, "%(k,repr(__v))
                 numpy.set_printoptions(precision=8,threshold=1000,linewidth=75)
             if len(__ktext) > 0:
                 __text += " with values:" + __ktext