diff --git a/annofabcli/__version__.py b/annofabcli/__version__.py index d541f60b..d5508a4b 100644 --- a/annofabcli/__version__.py +++ b/annofabcli/__version__.py @@ -1 +1 @@ -__version__ = "1.66.1" +__version__ = "1.66.2" diff --git a/annofabcli/filesystem/mask_user_info.py b/annofabcli/filesystem/mask_user_info.py index 2bb38a4c..941cef9b 100644 --- a/annofabcli/filesystem/mask_user_info.py +++ b/annofabcli/filesystem/mask_user_info.py @@ -136,7 +136,18 @@ def _get_tuple_column(df: pandas.DataFrame, column: str) -> Union[str, Tuple]: return column -def replace_by_columns(df, replacement_dict: Dict[str, str], main_column: Any, sub_columns: Optional[List[Any]] = None): +def replace_by_columns( + df: pandas.DataFrame, replacement_dict: Dict[str, str], main_column: Any, sub_columns: Optional[List[Any]] = None +): + """引数dfの中のユーザ情報を、指定した列名を元に置換します。 + + Args: + df (pandas.DataFrame): _description_ + replacement_dict (Dict[str, str]): 置換対象のuser_idと置換後のuser_id(username)。key: 置換対象のuser_id, value: 置換後のuser_id + main_column: 置換対象の列名(ex: user_id) + sub_column: main_columnと同じ値で置換する列(ex: username) + """ + def _get_username(row, main_column: Any, sub_column: Any) -> str: if row[main_column] in replacement_dict: return replacement_dict[row[main_column]] diff --git a/annofabcli/stat_visualization/mask_visualization_dir.py b/annofabcli/stat_visualization/mask_visualization_dir.py index 0a785698..9bad4c07 100755 --- a/annofabcli/stat_visualization/mask_visualization_dir.py +++ b/annofabcli/stat_visualization/mask_visualization_dir.py @@ -32,7 +32,6 @@ def _replace_df_task(task: Task, replacement_dict_by_user_id: Dict[str, str]) -> Task: df_output = task.df.copy() - replace_by_columns(df_output, replacement_dict_by_user_id, main_column="user_id", sub_columns=["username"]) replace_by_columns( df_output, diff --git a/annofabcli/statistics/table.py b/annofabcli/statistics/table.py index 02ef9e78..0de1dcb1 100644 --- a/annofabcli/statistics/table.py +++ b/annofabcli/statistics/table.py @@ -144,11 +144,6 @@ def set_task_histories(cls, task: Task, task_histories: List[TaskHistory]): for e in task_histories ) - # APIで取得した 'number_of_rejections' は非推奨で、number_of_rejections_by_inspection/acceptanceと矛盾する場合があるので、書き換える - task["number_of_rejections"] = ( - task["number_of_rejections_by_inspection"] + task["number_of_rejections_by_acceptance"] - ) - return task @staticmethod diff --git a/annofabcli/statistics/visualization/dataframe/task.py b/annofabcli/statistics/visualization/dataframe/task.py index 44e05081..4da50e3b 100644 --- a/annofabcli/statistics/visualization/dataframe/task.py +++ b/annofabcli/statistics/visualization/dataframe/task.py @@ -242,10 +242,8 @@ def to_csv(self, output_file: Path) -> None: "phase", "phase_stage", "status", - "number_of_rejections", "number_of_rejections_by_inspection", "number_of_rejections_by_acceptance", - "first_acceptance_completed_datetime", # 1回目の教師付フェーズ "first_annotation_user_id", "first_annotation_username", @@ -261,6 +259,8 @@ def to_csv(self, output_file: Path) -> None: "first_acceptance_username", "first_acceptance_worktime_hour", "first_acceptance_started_datetime", + # 最後の受入 + "first_acceptance_completed_datetime", # 作業時間に関する内容 "worktime_hour", "annotation_worktime_hour", diff --git "a/docs/command_reference/statistics/visualize/out_dir/\343\202\277\343\202\271\343\202\257list.csv" "b/docs/command_reference/statistics/visualize/out_dir/\343\202\277\343\202\271\343\202\257list.csv" index 88cf0669..a4529232 100644 --- "a/docs/command_reference/statistics/visualize/out_dir/\343\202\277\343\202\271\343\202\257list.csv" +++ "b/docs/command_reference/statistics/visualize/out_dir/\343\202\277\343\202\271\343\202\257list.csv" @@ -1,3 +1,3 @@ -project_id,task_id,phase,phase_stage,status,user_id,username,number_of_rejections,number_of_rejections_by_inspection,number_of_rejections_by_acceptance,started_datetime,updated_datetime,first_acceptance_completed_datetime,sampling,first_annotation_user_id,first_annotation_username,first_annotation_worktime_hour,first_annotation_started_datetime,first_inspection_user_id,first_inspection_username,first_inspection_worktime_hour,first_inspection_started_datetime,first_acceptance_user_id,first_acceptance_username,first_acceptance_worktime_hour,first_acceptance_started_datetime,worktime_hour,annotation_worktime_hour,inspection_worktime_hour,acceptance_worktime_hour,first_annotator_worktime_hour,first_inspector_worktime_hour,first_acceptor_worktime_hour,input_data_count,annotation_count,inspection_comment_count,input_data_count_of_inspection,annotator_is_changed,inspector_is_changed,acceptor_is_changed,inspection_is_skipped,acceptance_is_skipped,diff_days_to_first_acceptance_started,diff_days_to_first_inspection_started,diff_days_to_first_acceptance_completed,metadata -prj1,task1,acceptance,1,complete,NZ,NZ,0,0,0,2020-09-01T11:08:47.598+09:00,2020-09-01T11:09:40.359+09:00,2020-09-01T11:09:40.351+09:00,,QU,QU,0.091450555555556,2020-09-01T09:44:35.431+09:00,,,0,,NZ,NZ,0.014653611111111,2020-09-01T11:08:47.598+09:00,0.106104166666667,0.091450555555556,0,0.014653611111111,0.091450555555556,0,0.014653611111111,20,194,0,0,False,False,False,False,False,0.058474155092593,,0.059084722222222,{} -prj1,task2,acceptance,1,complete,NZ,NZ,0,0,0,2020-09-02T07:22:13.693+09:00,2020-09-02T07:23:38.295+09:00,2020-09-02T07:23:38.274+09:00,,KX,KX,0.533797777777778,2020-08-31T16:18:34.369+09:00,,,0,,NZ,NZ,0.023494722222222,2020-09-02T07:22:13.693+09:00,0.5572925,0.533797777777778,0,0.023494722222222,0.533797777777778,0,0.023494722222222,20,648,0,0,False,False,False,False,False,1.62753847222222,,1.62851741898148,{} +project_id,task_id,phase,phase_stage,status,number_of_rejections_by_inspection,number_of_rejections_by_acceptance,first_annotation_user_id,first_annotation_username,first_annotation_worktime_hour,first_annotation_started_datetime,first_inspection_user_id,first_inspection_username,first_inspection_worktime_hour,first_inspection_started_datetime,first_acceptance_user_id,first_acceptance_username,first_acceptance_worktime_hour,first_acceptance_started_datetime,first_acceptance_completed_datetime,worktime_hour,annotation_worktime_hour,inspection_worktime_hour,acceptance_worktime_hour,input_data_count,annotation_count,inspection_comment_count,inspection_is_skipped,acceptance_is_skipped +prj1,task1,acceptance,1,complete,0,0,TP,TP,0.091450555555556,2020-09-01T09:44:35.431+09:00,,,0,,QF,QF,0.014653611111111,2020-09-01T11:08:47.598+09:00,2020-09-01T11:09:40.351+09:00,0.106104166666667,0.091450555555556,0,0.014653611111111,20,194,0,False,False +prj1,task2,acceptance,1,complete,0,0,MO,MO,0.533797777777778,2020-08-31T16:18:34.369+09:00,,,0,,QF,QF,0.023494722222222,2020-09-02T07:22:13.693+09:00,2020-09-02T07:23:38.274+09:00,0.5572925,0.533797777777778,0,0.023494722222222,20,648,0,False,False diff --git "a/docs/command_reference/statistics/visualize_output_rst/\343\202\277\343\202\271\343\202\257list_csv.rst" "b/docs/command_reference/statistics/visualize_output_rst/\343\202\277\343\202\271\343\202\257list_csv.rst" index 864ae807..48312b24 100644 --- "a/docs/command_reference/statistics/visualize_output_rst/\343\202\277\343\202\271\343\202\257list_csv.rst" +++ "b/docs/command_reference/statistics/visualize_output_rst/\343\202\277\343\202\271\343\202\257list_csv.rst" @@ -9,4 +9,27 @@ * 教師付/検査/受入の作業時間 * 最初に教師付/検査/受入したユーザ +以下に、列名から内容が判断しづらい列の詳細を記載します。 + +* number_of_rejections_by_inspection : 検査フェーズで差し戻された回数 +* number_of_rejections_by_acceptance : 受入フェーズで差し戻された回数 + +* first_annotation_user_id : 最初に教師付フェーズを開始したユーザーのuser_id +* first_annotation_username : 最初に教師付フェーズを開始したユーザーのusername +* first_annotation_worktime_hour : 最初に教師付フェーズの作業時間[hour] +* first_annotation_started_datetime : 最初に教師付フェーズを開始した日時 + +* worktime_hour: 作業時間[hour] +* annotation_worktime_hour: 教師付作業時間[hour] +* inspection_worktime_hour: 検査作業時間[hour] +* acceptance_worktime_hour: 受入作業時間[hour] + +* input_data_count : タスクに含まれる入力データ数 +* input_data_count : タスクに含まれるアノテーション数 +* inspection_comment_count : 指摘された検査コメント数(対応不要のコメントは除く) + +* inspection_is_skipped : 抜取検査により検査フェーズがスキップされたか +* acceptance_is_skipped : 抜取受入により受入フェーズがスキップされたか + + `タスクlist.csv `_ diff --git a/pyproject.toml b/pyproject.toml index b4237e2c..3ddfeb03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "annofabcli" -version = "1.66.1" +version = "1.66.2" description = "Utility Command Line Interface for AnnoFab" authors = ["yuji38kwmt"] license = "MIT"