-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrecommendation_pipeline.puml
120 lines (112 loc) · 4.75 KB
/
recommendation_pipeline.puml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@startuml
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam sequence {
ArrowColor DeepSkyBlue
ActorBorderColor DeepSkyBlue
LifeLineBorderColor blue
LifeLineBackgroundColor #A9DCDF
ParticipantBorderColor DeepSkyBlue
ParticipantBackgroundColor DodgerBlue
ParticipantFontName Impact
ParticipantFontSize 17
ParticipantFontColor #A9DCDF
ActorBackgroundColor aqua
ActorFontColor DeepSkyBlue
ActorFontSize 17
ActorFontName Aapex
}
participant "main" as main
participant "check" as check
participant "handle_exclude_command_line" as handle_exclude_command_line
participant "run_thread" as run_thread
participant "run_recommend_for_file" as run_recommend_for_file
participant "find_annotation_by_node_type" as find_annotation_by_node_type
participant "run_recommend_for_file" as run_recommend_for_file
participant "calculate_patterns_and_metrics" as calculate_patterns_and_metrics
participant "run_recommend_for_file" as run_recommend_for_file
participant "Config" as Config
participant "__count_value" as __count_value
participant "inference" as inference
participant "add_pattern_if_ignored" as add_pattern_if_ignored
participant "create_xml_tree" as create_xml_tree
participant "get_exit_code" as get_exit_code
participant "format_converter_for_pattern" as format_converter_for_pattern
participant "predict" as predict
participant "PatternRankingModel.rank" as PatternRankingModel.rank
participant "get_exit_code" as get_exit_code
activate main
activate check
main -> check
check -> handle_exclude_command_line: parse cmd for exclude pattern
handle_exclude_command_line -> check: ignored files
check -> check: filter ignored files
|||
check -> run_thread: prepare ThreadPoolExecutor
activate run_thread
run_thread -> run_recommend_for_file: parallel run for each file
activate run_recommend_for_file
run_recommend_for_file -> find_annotation_by_node_type: for class_declaration
find_annotation_by_node_type -> run_recommend_for_file: annotations with class_declaration
run_recommend_for_file -> find_annotation_by_node_type: for field_declaration
find_annotation_by_node_type -> run_recommend_for_file: annotations with field_declaration
run_recommend_for_file -> find_annotation_by_node_type: for method_declaration
find_annotation_by_node_type -> run_recommend_for_file: annotations with method_declaration
run_recommend_for_file -> calculate_patterns_and_metrics
activate calculate_patterns_and_metrics
calculate_patterns_and_metrics -> Config: get_patterns_config()
Config -> calculate_patterns_and_metrics: config with patterns and metrics
calculate_patterns_and_metrics -> __count_value: pass config
activate __count_value
__count_value -> __count_value: run value() of a pattern/metric
__count_value -> calculate_patterns_and_metrics: input_params, code_lines_dict, error_string
deactivate __count_value
deactivate calculate_patterns_and_metrics
run_recommend_for_file -> inference: input_params, code_lines_dict, args
activate inference
inference -> Config: folder_model_data()
Config -> inference: filename for model loading
inference -> inference: pickle load PatternRankingModel
inference -> predict: input_params, model, args
activate predict
predict -> predict: get features order from PatternRankingModel
predict-> PatternRankingModel.rank: input_params
activate PatternRankingModel.rank
PatternRankingModel.rank -> PatternRankingModel.rank: predict value with catboost, input_params as input
PatternRankingModel.rank -> PatternRankingModel.rank: predict decreased value with catboost, input_params as input
PatternRankingModel.rank -> predict: preds, importances
deactivate PatternRankingModel.rank
predict -> inference: sorted_patterns_codes, importances
deactivate predict
inference -> inference: calulate aibolit score based on sorted_patterns_codes, importances
inference -> run_recommend_for_file: results_list
deactivate inference
run_recommend_for_file -> add_pattern_if_ignored: input is results_list
activate add_pattern_if_ignored
{static} add_pattern_if_ignored -> run_recommend_for_file: output is filtered array
deactivate add_pattern_if_ignored
run_recommend_for_file -> run_thread: future
deactivate run_recommend_for_file
run_thread -> check: yield future.result()
deactivate run_thread
check -> get_exit_code: pass results
get_exit_code -> check: exit code
activate check #DarkSalmon
check -> create_xml_tree: if args.format == 'xml':
activate create_xml_tree
create_xml_tree -> check: xml root
deactivate create_xml_tree
check -> check: write xml
check -> format_converter_for_pattern
activate format_converter_for_pattern
format_converter_for_pattern -> check: prepared data structure
deactivate format_converter_for_pattern
check -> create_text
activate create_text
create_text -> check: ascii text
deactivate create_text
deactivate check
check -> main: exit code
deactivate check
deactivate main
@enduml