if not isinstance(study_config, dict):
logging.fatal("Study configuration is not a dictionnary")
sys.exit(1)
-
+
# Name
if "Name" not in study_config:
logging.fatal("Cannot found Name in the study configuration")
"\n You can choose between : " + str(AssimAlgos))
sys.exit(1)
+ # Debug
+ if "Debug" not in study_config:
+ study_config["Debug"] = "0"
+
# Check if all the data is provided
for key in AlgoDataRequirements[study_config["Algorithm"]]:
if key not in study_config.keys():
check_data(key, study_config[key])
# Analyse
- if "Analysis" in study_config.keys():
- analysis_config = study_config["Analysis"]
+ if "UserPostAnalysis" in study_config.keys():
+ analysis_config = study_config["UserPostAnalysis"]
if "From" not in analysis_config:
- logging.fatal("Analysis found but From is not defined in the analysis configuration !")
+ logging.fatal("UserPostAnalysis found but From is not defined in the analysis configuration !")
sys.exit(1)
else:
if analysis_config["From"] not in AnalysisFromList:
# Step 0.5: Find if there is a user init node
init_config = {}
init_config["Target"] = []
- if "Init" in study_config.keys():
- init_config = study_config["Init"]
- factory_init_node = catalogAd._nodeMap["InitUserDataFromScript"]
- init_node = factory_init_node.cloneNode("InitUserData")
+ if "UserDataInit" in study_config.keys():
+ init_config = study_config["UserDataInit"]
+ factory_init_node = catalogAd._nodeMap["UserDataInitFromScript"]
+ init_node = factory_init_node.cloneNode("UserDataInit")
init_node.getInputPort("script").edInitPy(init_config["Data"])
proc.edAddChild(init_node)
proc.edAddChild(compute_bloc)
proc.edAddCFLink(CAS_node, compute_bloc)
- if AlgoType[study_config["Algorithm"]] == "Direct":
- # We don't need to use an optimizer loop
- factory_execute_node = catalogAd._nodeMap["SimpleExecuteDirectAlgorithm"]
- execute_node = factory_execute_node.cloneNode("Execute" + study_config["Algorithm"])
- compute_bloc.edAddChild(execute_node)
- proc.edAddDFLink(CAS_node.getOutputPort("Study"), execute_node.getInputPort("Study"))
-
if AlgoType[study_config["Algorithm"]] == "Optim":
# We use an optimizer loop
name = "Execute" + study_config["Algorithm"]
proc.edAddDFLink(opt_script_node.getOutputPort("result"), optimizer_node.edGetPortForOutPool())
# Step 4: create post-processing from user configuration
- if "Analysis" in study_config.keys():
- analysis_config = study_config["Analysis"]
+ if "UserPostAnalysis" in study_config.keys():
+ analysis_config = study_config["UserPostAnalysis"]
if analysis_config["From"] == "String":
factory_analysis_node = catalogAd._nodeMap["SimpleUserAnalysis"]
- analysis_node = factory_analysis_node.cloneNode("User Analysis")
+ analysis_node = factory_analysis_node.cloneNode("UsePostAnalysis")
default_script = analysis_node.getScript()
final_script = default_script + analysis_config["Data"]
analysis_node.setScript(final_script)
proc.edAddDFLink(execute_node.getOutputPort("Study"), analysis_node.getInputPort("Study"))
# Connect node with InitUserData
- if "Analysis" in init_config["Target"]:
+ if "UserPostAnalysis" in init_config["Target"]:
analysis_node.edAddInputPort("init_data", t_pyobj)
proc.edAddDFLink(init_node.getOutputPort("init_data"), analysis_node.getInputPort("init_data"))
elif analysis_config["From"] == "Script":
factory_analysis_node = catalogAd._nodeMap["SimpleUserAnalysis"]
- analysis_node = factory_analysis_node.cloneNode("User Analysis")
+ analysis_node = factory_analysis_node.cloneNode("UserPostAnalysis")
default_script = analysis_node.getScript()
if not os.path.exists(analysis_config["Data"]):
logging.fatal("Analysis source file does not exists ! :" + str(analysis_config["Data"]))
else:
proc.edAddDFLink(execute_node.getOutputPort("Study"), analysis_node.getInputPort("Study"))
# Connect node with InitUserData
- if "Analysis" in init_config["Target"]:
+ if "UserPostAnalysis" in init_config["Target"]:
analysis_node.edAddInputPort("init_data", t_pyobj)
proc.edAddDFLink(init_node.getOutputPort("init_data"), analysis_node.getInputPort("init_data"))