type = "Matrix"
# Get file path and filename
+try:
+ if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+ sys.path.insert(0,studydir)
+except:
+ pass
filepath = os.path.dirname(script)
filename = os.path.basename(script)
module_name = os.path.splitext(filename)[0]
type = "ScalarSparseMatrix"
# Get file path and filename
+try:
+ if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+ sys.path.insert(0,studydir)
+except:
+ pass
filepath = os.path.dirname(script)
filename = os.path.basename(script)
module_name = os.path.splitext(filename)[0]
type = "DiagonalSparseMatrix"
# Get file path and filename
+try:
+ if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+ sys.path.insert(0,studydir)
+except:
+ pass
filepath = os.path.dirname(script)
filename = os.path.basename(script)
module_name = os.path.splitext(filename)[0]
type = "Vector"
# Get file path and filename
+try:
+ if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+ sys.path.insert(0,studydir)
+except:
+ pass
filepath = os.path.dirname(script)
filename = os.path.basename(script)
module_name = os.path.splitext(filename)[0]
type = "VectorSerie"
# Get file path and filename
+try:
+ if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+ sys.path.insert(0,studydir)
+except:
+ pass
filepath = os.path.dirname(script)
filename = os.path.basename(script)
module_name = os.path.splitext(filename)[0]
logging.debug("CREATE Entering in CreateDictFromScript")
# Get file path and filename
+try:
+ if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+ sys.path.insert(0,studydir)
+except:
+ pass
filepath = os.path.dirname(script)
filename = os.path.basename(script)
module_name = os.path.splitext(filename)[0]
logging.debug("CREATE Entering in UserDataInitFromScript")
# Get file path and filename
+try:
+ if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+ sys.path.insert(0,studydir)
+except:
+ pass
filepath = os.path.dirname(script)
filename = os.path.basename(script)
module_name = os.path.splitext(filename)[0]
raise ValueError("\n\nAnalysis found but Data is not defined in the analysis configuration!\n")
if analysis_config["From"] == "Script":
- check_file_name = ""
- if check_repertory:
+ check_file_name = analysis_config["Data"]
+ if check_repertory and not os.path.exists(check_file_name):
check_file_name = os.path.join(repertory, os.path.basename(analysis_config["Data"]))
- else:
- check_file_name = analysis_config["Data"]
if not os.path.exists(check_file_name):
raise ValueError("\n\n The script file cannot be found for UserPostAnalysis,\n please check its availability.\n"+
" The given user file is:\n %s\n" % check_file_name)
# Check des fichiers
from_type = data_config["From"]
if from_type == "Script":
- check_file_name = ""
- if repertory_check:
+ check_file_name = data_config["Data"]
+ if repertory_check and not os.path.exists(check_file_name):
check_file_name = os.path.join(repertory, os.path.basename(data_config["Data"]))
- else:
- check_file_name = data_config["Data"]
if not os.path.exists(check_file_name):
raise ValueError("\n\n The script file cannot be found for the \"%s\" keyword, please \n check its availability. The given user file is:\n %s\n"%(from_type,check_file_name))
elif from_type == "FunctionDict":
FunctionDict = data_config["Data"]
for FunctionName in FunctionDict["Function"]:
- check_file_name = ""
- if repertory_check:
+ check_file_name = FunctionDict["Script"][FunctionName]
+ if repertory_check and not os.path.exists(check_file_name):
check_file_name = os.path.join(repertory, os.path.basename(FunctionDict["Script"][FunctionName]))
- else:
- check_file_name = FunctionDict["Script"][FunctionName]
if not os.path.exists(check_file_name):
raise ValueError("\n\n The script file cannot be found for the \"%s\" keyword, please \n check its availability. The given user file is:\n %s\n"%(from_type,check_file_name))
elif from_type == "ScriptWithSwitch":
ScriptWithSwitch = data_config["Data"]
for FunctionName in ScriptWithSwitch["Function"]:
- check_file_name = ""
- if repertory_check:
+ check_file_name = ScriptWithSwitch["Script"][FunctionName]
+ if repertory_check and not os.path.exists(check_file_name):
check_file_name = os.path.join(repertory, os.path.basename(ScriptWithSwitch["Script"][FunctionName]))
- else:
- check_file_name = ScriptWithSwitch["Script"][FunctionName]
if not os.path.exists(check_file_name):
raise ValueError("\n\n The script file cannot be found for the \"%s\" keyword, please \n check its availability. The given user file is:\n %s\n"%(from_type,check_file_name))
elif from_type == "ScriptWithFunctions":
ScriptWithFunctions = data_config["Data"]
for FunctionName in ScriptWithFunctions["Function"]:
- check_file_name = ""
- if repertory_check:
+ check_file_name = ScriptWithFunctions["Script"][FunctionName]
+ if repertory_check and not os.path.exists(check_file_name):
check_file_name = os.path.join(repertory, os.path.basename(ScriptWithFunctions["Script"][FunctionName]))
- else:
- check_file_name = ScriptWithFunctions["Script"][FunctionName]
if not os.path.exists(check_file_name):
raise ValueError("\n\n The script file cannot be found for the \"%s\" keyword, please \n check its availability. The given user file is:\n %s\n"%(from_type,check_file_name))
elif from_type == "ScriptWithOneFunction":
ScriptWithOneFunction = data_config["Data"]
for FunctionName in ScriptWithOneFunction["Function"]:
- check_file_name = ""
- if repertory_check:
+ check_file_name = ScriptWithOneFunction["Script"][FunctionName]
+ if repertory_check and not os.path.exists(check_file_name):
check_file_name = os.path.join(repertory, os.path.basename(ScriptWithOneFunction["Script"][FunctionName]))
- else:
- check_file_name = ScriptWithOneFunction["Script"][FunctionName]
if not os.path.exists(check_file_name):
raise ValueError("\n\n The script file cannot be found for the \"%s\" keyword, please \n check its availability. The given user file is:\n %s\n"%(from_type,check_file_name))
init_config = study_config["UserDataInit"]
factory_init_node = catalogAd.getNodeFromNodeMap("UserDataInitFromScript")
init_node = factory_init_node.cloneNode("UserDataInit")
- if repertory:
+ if repertory and not os.path.exists(init_config["Data"]):
init_node.getInputPort("script").edInitPy(os.path.join(base_repertory, os.path.basename(init_config["Data"])))
+ elif repertory and os.path.exists(init_config["Data"]):
+ init_node.getInputPort("script").edInitPy(init_config["Data"])
+ init_node.edAddInputPort("studydir", t_string)
+ init_node.getInputPort("studydir").edInitPy(base_repertory)
else:
init_node.getInputPort("script").edInitPy(init_config["Data"])
init_node_script = init_node.getScript()
# Create node
factory_back_node = catalogAd.getNodeFromNodeMap("CreateDictFromScript")
back_node = factory_back_node.cloneNode("Get" + key)
- if repertory:
+ if repertory and not os.path.exists(data_config["Data"]):
back_node.getInputPort("script").edInitPy(os.path.join(base_repertory, os.path.basename(data_config["Data"])))
+ elif repertory and os.path.exists(data_config["Data"]):
+ back_node.getInputPort("script").edInitPy(data_config["Data"])
+ back_node.edAddInputPort("studydir", t_string)
+ back_node.getInputPort("studydir").edInitPy(base_repertory)
else:
back_node.getInputPort("script").edInitPy(data_config["Data"])
back_node.edAddOutputPort(key, t_pyobj)
# Create node
factory_back_node = catalogAd.getNodeFromNodeMap("CreateNumpyVectorFromScript")
back_node = factory_back_node.cloneNode("Get" + key)
- if repertory:
+ if repertory and not os.path.exists(data_config["Data"]):
back_node.getInputPort("script").edInitPy(os.path.join(base_repertory, os.path.basename(data_config["Data"])))
+ elif repertory and os.path.exists(data_config["Data"]):
+ back_node.getInputPort("script").edInitPy(data_config["Data"])
+ back_node.edAddInputPort("studydir", t_string)
+ back_node.getInputPort("studydir").edInitPy(base_repertory)
else:
back_node.getInputPort("script").edInitPy(data_config["Data"])
back_node.edAddOutputPort(key, t_pyobj)
# Create node
factory_back_node = catalogAd.getNodeFromNodeMap("CreateNumpyVectorSerieFromScript")
back_node = factory_back_node.cloneNode("Get" + key)
- if repertory:
+ if repertory and not os.path.exists(data_config["Data"]):
back_node.getInputPort("script").edInitPy(os.path.join(base_repertory, os.path.basename(data_config["Data"])))
+ elif repertory and os.path.exists(data_config["Data"]):
+ back_node.getInputPort("script").edInitPy(data_config["Data"])
+ back_node.edAddInputPort("studydir", t_string)
+ back_node.getInputPort("studydir").edInitPy(base_repertory)
else:
back_node.getInputPort("script").edInitPy(data_config["Data"])
back_node.edAddOutputPort(key, t_pyobj)
# Create node
factory_back_node = catalogAd.getNodeFromNodeMap("CreateNumpy%sFromScript"%(data_config["Type"],))
back_node = factory_back_node.cloneNode("Get" + key)
- if repertory:
+ if repertory and not os.path.exists(data_config["Data"]):
back_node.getInputPort("script").edInitPy(os.path.join(base_repertory, os.path.basename(data_config["Data"])))
+ elif repertory and os.path.exists(data_config["Data"]):
+ back_node.getInputPort("script").edInitPy(data_config["Data"])
+ back_node.edAddInputPort("studydir", t_string)
+ back_node.getInputPort("studydir").edInitPy(base_repertory)
else:
back_node.getInputPort("script").edInitPy(data_config["Data"])
back_node.edAddOutputPort(key, t_pyobj)
for FunctionName in FunctionDict["Function"]:
port_name = "ObservationOperator" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(FunctionDict["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(FunctionDict["Script"][FunctionName])))
+ elif repertory and os.path.exists(FunctionDict["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(FunctionDict["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(FunctionDict["Script"][FunctionName])
for FunctionName in FunctionDict["Function"]:
port_name = "EvolutionModel" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(FunctionDict["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(FunctionDict["Script"][FunctionName])))
+ elif repertory and os.path.exists(FunctionDict["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(FunctionDict["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(FunctionDict["Script"][FunctionName])
for FunctionName in ScriptWithSwitch["Function"]:
port_name = "ObservationOperator" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(ScriptWithSwitch["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(ScriptWithSwitch["Script"][FunctionName])))
+ elif repertory and os.path.exists(ScriptWithSwitch["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(ScriptWithSwitch["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(ScriptWithSwitch["Script"][FunctionName])
for FunctionName in ScriptWithSwitch["Function"]:
port_name = "EvolutionModel" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(ScriptWithSwitch["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(ScriptWithSwitch["Script"][FunctionName])))
+ elif repertory and os.path.exists(ScriptWithSwitch["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(ScriptWithSwitch["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(ScriptWithSwitch["Script"][FunctionName])
for FunctionName in ScriptWithFunctions["Function"]:
port_name = "ObservationOperator" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(ScriptWithFunctions["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(ScriptWithFunctions["Script"][FunctionName])))
+ elif repertory and os.path.exists(ScriptWithFunctions["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(ScriptWithFunctions["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(ScriptWithFunctions["Script"][FunctionName])
for FunctionName in ScriptWithFunctions["Function"]:
port_name = "EvolutionModel" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(ScriptWithFunctions["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(ScriptWithFunctions["Script"][FunctionName])))
+ elif repertory and os.path.exists(ScriptWithFunctions["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(ScriptWithFunctions["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(ScriptWithFunctions["Script"][FunctionName])
for FunctionName in ScriptWithOneFunction["Function"]:
port_name = "ObservationOperator" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(ScriptWithOneFunction["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(ScriptWithOneFunction["Script"][FunctionName])))
+ elif repertory and os.path.exists(ScriptWithOneFunction["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(ScriptWithOneFunction["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(ScriptWithOneFunction["Script"][FunctionName])
for FunctionName in ScriptWithOneFunction["Function"]:
port_name = "EvolutionModel" + FunctionName
CAS_node.edAddInputPort(port_name, t_string)
- if repertory:
+ if repertory and not os.path.exists(ScriptWithOneFunction["Script"][FunctionName]):
CAS_node.getInputPort(port_name).edInitPy(os.path.join(base_repertory, os.path.basename(ScriptWithOneFunction["Script"][FunctionName])))
+ elif repertory and os.path.exists(ScriptWithOneFunction["Script"][FunctionName]):
+ CAS_node.getInputPort(port_name).edInitPy(ScriptWithOneFunction["Script"][FunctionName])
+ try:
+ CAS_node.edAddInputPort("studydir", t_string)
+ CAS_node.getInputPort("studydir").edInitPy(base_repertory)
+ except: pass
else:
CAS_node.getInputPort(port_name).edInitPy(ScriptWithOneFunction["Script"][FunctionName])
# We create a new pyscript node
opt_script_nodeOO = runtime.createScriptNode("", "FunctionNodeOO")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
break
# We create a new pyscript node
opt_script_nodeOO = runtime.createScriptNode("", "FunctionNodeOO")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
# We create a new pyscript node
opt_script_nodeOO = runtime.createScriptNode("", "FunctionNodeOO")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
# We create a new pyscript node
opt_script_nodeOO = runtime.createScriptNode("", "FunctionNodeOO")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
# We create a new pyscript node
opt_script_nodeEM = runtime.createScriptNode("", "FunctionNodeEM")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
# We create a new pyscript node
opt_script_nodeEM = runtime.createScriptNode("", "FunctionNodeEM")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
break
# We create a new pyscript node
opt_script_nodeEM = runtime.createScriptNode("", "FunctionNodeEM")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
break
# We create a new pyscript node
opt_script_nodeEM = runtime.createScriptNode("", "FunctionNodeEM")
- if repertory:
+ if repertory and not os.path.exists(script_filename):
script_filename = os.path.join(base_repertory, os.path.basename(script_filename))
try:
script_str= open(script_filename, 'r')
else:
factory_observation_node = catalogAd.getNodeFromNodeMap("ObservationNodeFile")
observation_node = factory_observation_node.cloneNode("Observation")
- if repertory:
+ if repertory and not os.path.exists(observer_cfg["Script"]):
observation_node.getInputPort("script").edInitPy(os.path.join(base_repertory, os.path.basename(observer_cfg["Script"])))
+ elif repertory and os.path.exists(observer_cfg["Script"]):
+ observation_node.getInputPort("script").edInitPy(observer_cfg["Script"])
+ observation_node.edAddInputPort("studydir", t_string)
+ observation_node.getInputPort("studydir").edInitPy(base_repertory)
else:
observation_node.getInputPort("script").edInitPy(observer_cfg["Script"])
observer_bloc.edAddChild(observation_node)
analysis_node = factory_analysis_node.cloneNode("UserPostAnalysis")
default_script = analysis_node.getScript()
analysis_file_name = analysis_config["Data"]
- if repertory:
+ if repertory and not os.path.exists(analysis_file_name):
analysis_file_name = os.path.join(base_repertory, os.path.basename(analysis_file_name))
try:
analysis_file = open(analysis_file_name, 'r')