/
example_analysis_CSVAnalyzer.py
31 lines (24 loc) · 1.4 KB
/
example_analysis_CSVAnalyzer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Example CSVAnalyzer for any experiment
# In this example, we will demonstrate how to use a CSVAnalyzer to analyze csv files for experiments
# First, import some necessary system and idmtools packages.
from idmtools.analysis.analyze_manager import AnalyzeManager
from idmtools.analysis.csv_analyzer import CSVAnalyzer
from idmtools.core import ItemType
from idmtools.core.platform_factory import Platform
if __name__ == '__main__':
# Set the platform where you want to run your analysis
# In this case we are running in COMPS since the Work Item we are analyzing was run on COMPS
platform = Platform('COMPS2')
# Arg option for analyzer init are uid, working_dir, data in the method map (aka select_simulation_data),
# and filenames
# In this case, we want to provide a filename to analyze
filenames = ['output/c.csv']
# Initialize the analyser class with the path of the output csv file
analyzers = [CSVAnalyzer(filenames=filenames)]
# Set the experiment id you want to analyze
experiment_id = '9311af40-1337-ea11-a2be-f0921c167861' # staging exp id simple sim and csv example
# Specify the id Type, in this case an Experiment on COMPS
manager = AnalyzeManager(configuration={}, partial_analyze_ok=True, platform=platform,
ids=[(experiment_id, ItemType.EXPERIMENT)],
analyzers=analyzers)
manager.analyze()