77import seaborn as sns
88import scipy
99
10+ from config import ROOT_DIR
11+
1012plt .rcParams .update ({'font.size' : 26 })
1113
1214graph_label = dict (color = '#202020' , alpha = 0.9 )
1315
1416
1517def load_snippet_metrics ():
1618 print ('\n ##### \n read complexity metric data' )
17- snippet_metrics = pd .read_csv (".. /data/metrics/SnippetComplexityMetricsValues.csv" , delimiter = "," )
19+ snippet_metrics = pd .read_csv (ROOT_DIR + " /data/metrics/SnippetComplexityMetricsValues.csv" , delimiter = "," )
1820 snippet_metrics = snippet_metrics .astype ('float' , errors = 'ignore' )
1921 print (snippet_metrics .head (5 ))
2022 return snippet_metrics
@@ -23,7 +25,7 @@ def load_snippet_metrics():
2325def load_behavioral_data ():
2426 print ('\n ##### \n read behavioral data' )
2527
26- behavioral_data = pd .read_csv (".. /data/behavioral/ParticipantBehavior.csv" , delimiter = "," )
28+ behavioral_data = pd .read_csv (ROOT_DIR + " /data/behavioral/ParticipantBehavior.csv" , delimiter = "," )
2729 behavioral_data = behavioral_data .astype ('float' , errors = 'ignore' )
2830
2931 behavioral_data = behavioral_data [behavioral_data ['Condition' ] == "Comprehension" ]
@@ -64,7 +66,7 @@ def plot_correlation_correctness(df, metric):
6466 sns .despine ()
6567 plt .tight_layout ()
6668
67- plt .savefig (' output/' + metric + '_Correctness.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
69+ plt .savefig (ROOT_DIR + '/analysis/ output/' + metric + '_Correctness.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
6870
6971
7072def plot_correlation_responsetime (df , metric ):
@@ -97,7 +99,7 @@ def plot_correlation_responsetime(df, metric):
9799 sns .despine ()
98100 plt .tight_layout ()
99101
100- plt .savefig (' output/' + metric + '_ResponseTime.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
102+ plt .savefig (ROOT_DIR + '/analysis/ output/' + metric + '_ResponseTime.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
101103
102104
103105def plot_correlation_subjcomplexity_metrics (df , metric ):
@@ -130,7 +132,7 @@ def plot_correlation_subjcomplexity_metrics(df, metric):
130132 sns .despine ()
131133 plt .tight_layout ()
132134
133- plt .savefig (' output/SubjComplexity_' + metric + '.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
135+ plt .savefig (ROOT_DIR + '/analysis/ output/SubjComplexity_' + metric + '.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
134136
135137
136138def plot_correlation_subjcomplexity_responsetime (df ):
@@ -158,7 +160,7 @@ def plot_correlation_subjcomplexity_responsetime(df):
158160 sns .despine ()
159161 plt .tight_layout ()
160162
161- plt .savefig (' output/SubjComplexity_ResponseTime.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
163+ plt .savefig (ROOT_DIR + '/analysis/ output/SubjComplexity_ResponseTime.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
162164
163165
164166def plot_correlation_subjcomplexity_correctness (df ):
@@ -186,7 +188,7 @@ def plot_correlation_subjcomplexity_correctness(df):
186188 sns .despine ()
187189 plt .tight_layout ()
188190
189- plt .savefig (' output/SubjComplexity_Correctness.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
191+ plt .savefig (ROOT_DIR + '/analysis/ output/SubjComplexity_Correctness.pdf' , dpi = 300 , bbox_inches = 'tight' , pad_inches = 0 )
190192
191193
192194def select_color_for_metric (metric ):
@@ -242,7 +244,7 @@ def main():
242244
243245 # correlate with behavioral data
244246 print ('\n ##### \n correlating subjective complexity with behavioral data' )
245- snippet_subjective_complexity = pd .read_csv ('.. /data/subjective/SnippetSubjectiveComplexityRatings.csv' )
247+ snippet_subjective_complexity = pd .read_csv (ROOT_DIR + ' /data/subjective/SnippetSubjectiveComplexityRatings.csv' )
246248
247249 print ('mean:' + str (snippet_subjective_complexity ['subj_complexity' ].mean ()))
248250 print ('std:' + str (snippet_subjective_complexity ['subj_complexity' ].std (ddof = 1 )))
0 commit comments