run_analysis
- czmtestkit.py_modules.run_analysis(JobID, analysis_func, setup_func=None)
Sequentially run python functions using dictionaries from the
Database.json. (See example fromrun_sim()for details on generating theDatabase.json). Output dictionary items are appended to theDatabase.jsonfile.- Parameters
JobID (str): ID for colleciton of tests in the design of experiments.
analysis_func (function object): Post processing function using output from
run_sim().setup_func (function object): Setup for the post processing function.
Example
To analyze data from the
Databasegenerated withrun_sim()for example:$ <current working directory> └── ExampleDOE ├── point_00 ├── point_01 ├── point_02 ├── point_03 └── Database.json{'param_1': value_param1, ..., 'output2': value0_out2} {'param_1': value_param1, ..., 'output2': value1_out2} {'param_1': value_param1, ..., 'output2': value2_out2} {'param_1': value_param1, ..., 'output2': value3_out2}
using an analysis function that uses a dictionary from the Database as input. For example:
def analysisFunc(dict): ... return {'analysisOut1': <value>} dictIn = {'param_1': value_param1, ..., 'output2': value0_out2} dictOut = analysisFunc(dictIn)
run_analysis()can be used to iterate through the entries in the Database and append the resulting dictionary items to the database. Running the following coderun_analysis('ExampleDOE', analysisFunc)
will result in updated
Database.json.{'param_1': value_param1, ..., 'output2': value0_out2,'analysisOut1': value0_out3} {'param_1': value_param1, ..., 'output2': value1_out2,'analysisOut1': value1_out3} {'param_1': value_param1, ..., 'output2': value2_out2,'analysisOut1': value2_out3} {'param_1': value_param1, ..., 'output2': value3_out2,'analysisOut1': value3_out3}