Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,14 +10,11 @@ import pandas as pd
|
|
10 |
import subprocess
|
11 |
import plotly.express as px
|
12 |
def on_confirm(dataset_radio, num_parts_dropdown, token_counts_radio, line_counts_radio, cyclomatic_complexity_radio, problem_type_checkbox):
|
13 |
-
# 根据用户选择的参数构建文件路径
|
14 |
num_parts = num_parts_dropdown
|
15 |
-
|
16 |
-
|
17 |
-
# cyclomatic_complexity_split = cyclomatic_complexity_radio
|
18 |
|
19 |
|
20 |
-
# 读取数据
|
21 |
dataframes = []
|
22 |
if token_counts_radio=="Equal Frequency Partitioning":#等频划分,每个子集数据点的数量基本一致
|
23 |
token_counts_df = pd.read_csv(f"E:/python-testn/pythonProject3/hh_2/dividing_into_different_subsets/{num_parts}/QS/token_counts_QS.csv")
|
@@ -40,12 +37,11 @@ def on_confirm(dataset_radio, num_parts_dropdown, token_counts_radio, line_count
|
|
40 |
|
41 |
|
42 |
|
43 |
-
|
44 |
if problem_type_checkbox:
|
45 |
problem_type_df = pd.read_csv("E:/python-testn/pythonProject3/hh_2/dividing_into_different_subsets/cata_result.csv")
|
46 |
dataframes.append(problem_type_df)
|
47 |
|
48 |
-
# 如果所有三个radio都有value,将三个文件中的所有行拼接
|
49 |
if len(dataframes) > 0:
|
50 |
combined_df = dataframes[0]
|
51 |
for df in dataframes[1:]:
|
@@ -57,36 +53,6 @@ def on_confirm(dataset_radio, num_parts_dropdown, token_counts_radio, line_count
|
|
57 |
|
58 |
|
59 |
|
60 |
-
# 定义一个函数来返回数据
|
61 |
-
# def show_data(line_counts, token_counts, cyclomatic_complexity, problem_type, show_high, show_medium, show_low):
|
62 |
-
# columns = ["Model"]
|
63 |
-
#
|
64 |
-
# if token_counts:
|
65 |
-
# if show_high:
|
66 |
-
# columns.append("Token Counts.I")
|
67 |
-
#
|
68 |
-
# if show_medium:
|
69 |
-
# columns.append("Token Counts.II")
|
70 |
-
# if show_low:
|
71 |
-
# columns.append("Token Counts.III")
|
72 |
-
# if line_counts:
|
73 |
-
# if show_high:
|
74 |
-
# columns.append("Line Counts.I")
|
75 |
-
# if show_medium:
|
76 |
-
# columns.append("Line Counts.II")
|
77 |
-
# if show_low:
|
78 |
-
# columns.append("Line Counts.III")
|
79 |
-
# if cyclomatic_complexity:
|
80 |
-
# if show_high:
|
81 |
-
# columns.append("Cyclomatic Complexity.I")
|
82 |
-
# if show_medium:
|
83 |
-
# columns.append("Cyclomatic Complexity.II")
|
84 |
-
# if show_low:
|
85 |
-
# columns.append("Cyclomatic Complexity.III")
|
86 |
-
# if problem_type:
|
87 |
-
# columns.extend(["Problem Type_String", "Problem Type_Math", "Problem Type_Array"])
|
88 |
-
# return data[columns]
|
89 |
-
#用于更新数据文件的部分
|
90 |
def execute_specified_python_files(directory_list, file_list):
|
91 |
for directory in directory_list:
|
92 |
for py_file in file_list:
|
|
|
10 |
import subprocess
|
11 |
import plotly.express as px
|
12 |
def on_confirm(dataset_radio, num_parts_dropdown, token_counts_radio, line_counts_radio, cyclomatic_complexity_radio, problem_type_checkbox):
|
|
|
13 |
num_parts = num_parts_dropdown
|
14 |
+
current_dir = os.getcwd()
|
15 |
+
print("当前工作目录的路径:", current_dir)
|
|
|
16 |
|
17 |
|
|
|
18 |
dataframes = []
|
19 |
if token_counts_radio=="Equal Frequency Partitioning":#等频划分,每个子集数据点的数量基本一致
|
20 |
token_counts_df = pd.read_csv(f"E:/python-testn/pythonProject3/hh_2/dividing_into_different_subsets/{num_parts}/QS/token_counts_QS.csv")
|
|
|
37 |
|
38 |
|
39 |
|
40 |
+
|
41 |
if problem_type_checkbox:
|
42 |
problem_type_df = pd.read_csv("E:/python-testn/pythonProject3/hh_2/dividing_into_different_subsets/cata_result.csv")
|
43 |
dataframes.append(problem_type_df)
|
44 |
|
|
|
45 |
if len(dataframes) > 0:
|
46 |
combined_df = dataframes[0]
|
47 |
for df in dataframes[1:]:
|
|
|
53 |
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
def execute_specified_python_files(directory_list, file_list):
|
57 |
for directory in directory_list:
|
58 |
for py_file in file_list:
|