Revision e066fa74 fiddle/simulation_analysis/analyzer.py

View differences:

fiddle/simulation_analysis/analyzer.py
3 3
import argparse
4 4
import os
5 5
import utility
6
from process_out1 import process_out1
7
from process_out2 import process_out2
8 6

  
9 7
class Analyzer():
10 8
    analyzer_types = {1: "process_out1",
......
36 34
        bc_result = utility.get_statistical_data(input_data, 'filename', 'bc_time')
37 35
        hbc_result = utility.get_statistical_data(input_data, 'filename', 'hbc_time')
38 36

  
39
        output_data = utility.format_output_data_out1(bc_result, hbc_result)
37
        output_data = utility.format_output_data(bc_result, hbc_result)
40 38
        utility.write_to_file(output_filepath, output_data)
41 39
        return True
42 40

  
......
45 43
        bc_result = utility.get_statistical_data(input_data, 'typotype', 'avg_bc')
46 44
        hbc_result = utility.get_statistical_data(input_data, 'typotype', 'avg_hbc')
47 45

  
48
        output_data = utility.format_output_data_out2(bc_result, hbc_result)
46
        output_data = utility.format_output_data(bc_result, hbc_result)
49 47
        utility.write_to_file(output_filepath, output_data)
50 48
        return True
51 49

  
......
68 66
    input_filename = os.path.splitext(os.path.basename(input_filepath))[0]
69 67
    output_filename = '%s.out%s' % (input_filename, (analyzer.args.type + 1))
70 68

  
71
    if analyzer.args.prefix:
72
        output_name = analyzer.args.prefix
73
        analyzer.args.output_file = '%s/%s' % (analyzer.args.prefix, output_filename)
69
    print output_filename
70

  
74 71

  
75 72
    # This option has higher priority
76 73
    if analyzer.args.output_file == "":
77 74
        analyzer.args.output_file = '%s/%s' % (input_dir, output_filename)
78 75

  
79

  
80

  
81 76
        output_filepath = '%s/%s.out2' % (input_dir, input_filename)
82

  
83 77
        analyzer.args.output_file = output_filepath
84 78

  
79
    if analyzer.args.prefix:
80
        output_name = analyzer.args.prefix
81
        analyzer.args.output_file = '%s/%s' % (analyzer.args.prefix, output_filename)
82

  
83
    print analyzer.args.output_file
85 84
    analyzer.analyze_result()

Also available in: Unified diff