from daCore import Templates
from daCore import Reporting
from daCore import version
+lpi = PlatformInfo.PlatformInfo()
# ==============================================================================
class GenericCaseViewer(object):
def _initialize(self, __multilines):
"Permet des pré-conversions automatiques simples de commandes ou clés"
__translation = {
- "Study_name" : "StudyName", # noqa: E203
- "Study_repertory" : "StudyRepertory", # noqa: E203
- "MaximumNumberOfSteps": "MaximumNumberOfIterations",
- "FunctionDict" : "ScriptWithSwitch", # noqa: E203
- "FUNCTIONDICT_FILE" : "SCRIPTWITHSWITCH_FILE", # noqa: E203
+ "Study_name" : "StudyName", # noqa: E203
+ "Study_repertory" : "StudyRepertory", # noqa: E203
+ "MaximumNumberOfSteps" : "MaximumNumberOfIterations", # noqa: E203
+ "EnableMultiProcessing": "EnableWiseParallelism",
+ "FunctionDict" : "ScriptWithSwitch", # noqa: E203
+ "FUNCTIONDICT_FILE" : "SCRIPTWITHSWITCH_FILE", # noqa: E203
}
for k, v in __translation.items():
__multilines = __multilines.replace(k, v)
GenericCaseViewer.__init__(self, __name, __objname, __content, __object)
self._addLine("# -*- coding: utf-8 -*-")
self._addLine("#\n# Python script using ADAO TUI\n#")
+ self._addLine("import numpy as np")
self._addLine("from numpy import array, matrix")
self._addLine("from adao import adaoBuilder")
self._addLine("%s = adaoBuilder.New('%s')"%(self._objname, self._name))
__v = __local[k]
if __v is None: continue # noqa: E701
if k == "Checked" and not __v: continue # noqa: E241,E271,E272,E701
- if k == "Stored" and not __v: continue # noqa: E241,E271,E272,E701
if k == "ColMajor" and not __v: continue # noqa: E241,E271,E272,E701
+ if k == "CrossObs" and not __v: continue # noqa: E241,E271,E272,E701
+ if k == "SyncObs" and __v: continue # noqa: E241,E271,E272,E701
if k == "InputFunctionAsMulti" and not __v: continue # noqa: E241,E271,E272,E701
- if k == "nextStep" and not __v: continue # noqa: E241,E271,E272,E701
if k == "PerformanceProfile" and __v: continue # noqa: E241,E271,E272,E701
+ if k == "Stored" and not __v: continue # noqa: E241,E271,E272,E701
+ if k == "nextStep" and not __v: continue # noqa: E241,E271,E272,E701
if k == "noDetails": continue # noqa: E241,E271,E272,E701
if isinstance(__v, Persistence.Persistence):
__v = __v.values()
self._observerIndex = 0
self._addLine("# -*- coding: utf-8 -*-")
self._addLine("#\n# Python script using ADAO COMM\n#")
+ self._addLine("import numpy as np")
self._addLine("from numpy import array, matrix")
self._addLine("#")
self._addLine("%s = {}"%__objname)
__text += "%s_config['Data'] = %s\n"%(__command, __v)
__text = __text.replace("''", "'")
__vectorIsScript = True
- elif __k in ('Stored', 'Checked', 'ColMajor', 'InputFunctionAsMulti', 'nextStep'):
+ elif __k in ('Stored', 'Checked', 'ColMajor', 'CrossObs', 'InputFunctionAsMulti', 'nextStep'):
if bool(__v):
__text += "%s_config['%s'] = '%s'\n"%(__command, __k, int(bool(__v)))
- elif __k in ('PerformanceProfile', 'noDetails'):
+ elif __k in ('PerformanceProfile', 'SyncObs', 'noDetails'):
if not bool(__v):
__text += "%s_config['%s'] = '%s'\n"%(__command, __k, int(bool(__v)))
else:
if os.path.isfile(__file) or os.path.islink(__file):
os.remove(__file)
# -----
- if not PlatformInfo.has_salome or \
- not PlatformInfo.has_adao:
+ if not lpi.has_salome or not lpi.has_adao:
raise ImportError(
- "Unable to get SALOME (%s) or ADAO (%s) environnement for YACS conversion.\n"%(PlatformInfo.has_salome, PlatformInfo.has_adao) + \
+ "Unable to get SALOME (%s) or ADAO (%s) environnement for YACS conversion.\n"%(lpi.has_salome, lpi.has_adao) + \
"Please load the right SALOME environnement before trying to use it.")
else:
from daYacsSchemaCreator.run import create_schema_from_content
__v = __local[k]
if __v is None: continue # noqa: E701
if k == "Checked" and not __v: continue # noqa: E241,E271,E272,E701
- if k == "Stored" and not __v: continue # noqa: E241,E271,E272,E701
if k == "ColMajor" and not __v: continue # noqa: E241,E271,E272,E701
+ if k == "CrossObs" and not __v: continue # noqa: E241,E271,E272,E701
+ if k == "SyncObs" and __v: continue # noqa: E241,E271,E272,E701
if k == "InputFunctionAsMulti" and not __v: continue # noqa: E241,E271,E272,E701
- if k == "nextStep" and not __v: continue # noqa: E241,E271,E272,E701
if k == "PerformanceProfile" and __v: continue # noqa: E241,E271,E272,E701
+ if k == "Stored" and not __v: continue # noqa: E241,E271,E272,E701
+ if k == "nextStep" and not __v: continue # noqa: E241,E271,E272,E701
if k == "noDetails": continue # noqa: E241,E271,E272,E701
if k == "Concept": continue # noqa: E241,E271,E272,E701
if k == "self": continue # noqa: E241,E271,E272,E701
self.__supportedformats["text/tab-separated-values"] = True
self.__supportedformats["application/numpy.npy"] = True
self.__supportedformats["application/numpy.npz"] = True
- self.__supportedformats["application/dymola.sdf"] = PlatformInfo.has_sdf
+ self.__supportedformats["application/dymola.sdf"] = lpi.has_sdf
return self.__supportedformats
def getvalue(self, ColNames=None, ColIndex=None ):
if __usecols is None: # Si une variable demandée n'existe pas
self._colnames = None
#
- elif self._format == "application/dymola.sdf" and PlatformInfo.has_sdf:
+ elif self._format == "application/dymola.sdf" and lpi.has_sdf:
import sdf
__content = sdf.load(self._filename)
__columns = None
__usecols = (0, 1, 2, 3)
def __replaceNoneN( s ):
- if s.strip() == b'None':
- return numpy.NINF
+ if s.strip() in (b'None', 'None'):
+ return -numpy.inf
else:
return s
def __replaceNoneP( s ):
- if s.strip() == b'None':
- return numpy.PINF
+ if s.strip() in (b'None', 'None'):
+ return numpy.inf
else:
return s
__converters = {2: __replaceNoneN, 3: __replaceNoneP}
__usecols = tuple(range(len(HeaderNames)))
def __replaceNone( s ):
- if s.strip() == b'None':
- return numpy.NAN
+ if s.strip() in (b'None', 'None'):
+ return numpy.nan
else:
return s
__converters = dict()