Skip to content

Commit

Permalink
fix pylint issues
Browse files Browse the repository at this point in the history
Signed-off-by: hsj576 <[email protected]>
  • Loading branch information
hsj576 committed Sep 21, 2023
1 parent 1e4917e commit 72fa77e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/storymanager/rank/rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _get_selected(self, test_cases, test_results) -> pd.DataFrame:
all_df = copy.deepcopy(self.all_df)
selected_df = pd.DataFrame(all_df, columns=header)
selected_df = selected_df.drop_duplicates(header[:-2])

# pylint: disable=E1136
paradigms = self.selected_dataitem.get("paradigms")
if paradigms != ["all"]:
selected_df = selected_df.loc[selected_df["paradigm"].isin(paradigms)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ def run(self):
self.cloud_task_index = self._train(self.cloud_task_index,
train_dataset_file,
r)

self.edge_task_index, tasks_detail, res = self.my_eval(
self.cloud_task_index,
eval_dataset_file,
r)

else:
infer_dataset_file, eval_dataset_file = dataset_files[r]
inference_results, unseen_task_train_samples = self._inference(
Expand All @@ -197,7 +197,7 @@ def run(self):
self.cloud_task_index = self._train(self.cloud_task_index,
unseen_task_train_samples,
r)

tmp_dict = {}
for j in range(1, rounds+1):
_, eval_dataset_file = dataset_files[j]
Expand Down Expand Up @@ -232,7 +232,7 @@ def run(self):
scores_list.append(tmp_dict[key])
my_dict[key] = scores_list
LOGGER.info(f"{key} scores: {scores_list}")


self.edge_task_index, tasks_detail, res = self.my_eval(self.cloud_task_index,
self.dataset.test_url,
Expand Down
10 changes: 5 additions & 5 deletions core/testenvmanager/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def split_dataset(self, dataset_url, dataset_format, ratio, method="default",
data_types=dataset_types,
output_dir=output_dir,
times=times)

if method == "hard-example_splitting":
return self._hard_example_splitting(dataset_url, dataset_format, ratio,
data_types=dataset_types,
Expand Down Expand Up @@ -341,16 +341,16 @@ def _hard_example_splitting(self, data_file, data_format, ratio,
all_num = len(all_data)
step = int(all_num / (times*2))
data_files.append((
self._get_dataset_file(all_data[:int((all_num * ratio)/2)], output_dir,
self._get_dataset_file(all_data[:int((all_num * ratio)/2)], output_dir,
data_types[0], 0, data_format),
self._get_dataset_file(all_data[int((all_num * ratio)/2):int(all_num/2)], output_dir,
self._get_dataset_file(all_data[int((all_num * ratio)/2):int(all_num/2)], output_dir,
data_types[1], 0, data_format)))
index = 1
while index <= times:
if index == times:
new_dataset = all_data[int(all_num/2) + step * (index - 1):]
new_dataset = all_data[int(all_num/2)+step*(index-1):]
else:
new_dataset = all_data[int(all_num/2) + step * (index - 1): int(all_num/2) + step * index]
new_dataset = all_data[int(all_num/2)+step*(index-1): int(all_num/2)+step*index]

new_num = len(new_dataset)

Expand Down

0 comments on commit 72fa77e

Please sign in to comment.