annofabcli 1.114.1__py3-none-any.whl → 1.114.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- annofabcli/task/update_metadata_of_task.py +4 -3
- annofabcli/task_count/list_by_phase.py +9 -3
- {annofabcli-1.114.1.dist-info → annofabcli-1.114.3.dist-info}/METADATA +1 -1
- {annofabcli-1.114.1.dist-info → annofabcli-1.114.3.dist-info}/RECORD +7 -7
- {annofabcli-1.114.1.dist-info → annofabcli-1.114.3.dist-info}/WHEEL +0 -0
- {annofabcli-1.114.1.dist-info → annofabcli-1.114.3.dist-info}/entry_points.txt +0 -0
- {annofabcli-1.114.1.dist-info → annofabcli-1.114.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -63,12 +63,13 @@ class UpdateMetadataOfTaskMain(CommandLineWithConfirm):
|
|
|
63
63
|
task_index: int | None = None,
|
|
64
64
|
) -> bool:
|
|
65
65
|
logging_prefix = f"{task_index + 1} 件目" if task_index is not None else ""
|
|
66
|
+
logging_prefix += f" task_id='{task_id}' :: "
|
|
66
67
|
task = self.service.wrapper.get_task_or_none(project_id, task_id)
|
|
67
68
|
if task is None:
|
|
68
|
-
logger.warning(f"{logging_prefix}
|
|
69
|
+
logger.warning(f"{logging_prefix}タスクは存在しないのでスキップします。")
|
|
69
70
|
return False
|
|
70
71
|
|
|
71
|
-
logger.debug(f"
|
|
72
|
+
logger.debug(f"{logging_prefix}現在のmetadata='{json.dumps(task['metadata'])}'")
|
|
72
73
|
|
|
73
74
|
if not self.confirm_processing(self.get_confirm_message(task_id, metadata)):
|
|
74
75
|
return False
|
|
@@ -81,7 +82,7 @@ class UpdateMetadataOfTaskMain(CommandLineWithConfirm):
|
|
|
81
82
|
request_body = {task_id: new_metadata}
|
|
82
83
|
self.service.api.patch_tasks_metadata(project_id, request_body=request_body)
|
|
83
84
|
|
|
84
|
-
logger.debug(f"{logging_prefix}
|
|
85
|
+
logger.debug(f"{logging_prefix}タスクのメタデータを更新しました。 :: 新しいmetadata={json.dumps(new_metadata)}")
|
|
85
86
|
return True
|
|
86
87
|
|
|
87
88
|
def set_metadata_to_task_wrapper(self, tpl: tuple[int, TaskMetadataInfo], project_id: str) -> bool:
|
|
@@ -214,7 +214,7 @@ def create_df_task(
|
|
|
214
214
|
# 入力データ数を計算
|
|
215
215
|
task["input_data_count"] = len(task["input_data_id_list"])
|
|
216
216
|
|
|
217
|
-
#
|
|
217
|
+
# 動画の長さを計算
|
|
218
218
|
video_duration_hour = 0
|
|
219
219
|
video_duration_minute = 0
|
|
220
220
|
for input_data_id in task["input_data_id_list"]:
|
|
@@ -229,7 +229,7 @@ def create_df_task(
|
|
|
229
229
|
# メタデータの値を抽出
|
|
230
230
|
metadata = task["metadata"]
|
|
231
231
|
for key in metadata_keys:
|
|
232
|
-
task[f"metadata.{key}"] = metadata
|
|
232
|
+
task[f"metadata.{key}"] = metadata.get(key)
|
|
233
233
|
|
|
234
234
|
columns = ["task_id", "phase", "input_data_count", "video_duration_hour", "video_duration_minute"] + [f"metadata.{key}" for key in metadata_keys] + ["task_status_for_summary"]
|
|
235
235
|
df = pandas.DataFrame(task_list, columns=columns)
|
|
@@ -271,7 +271,8 @@ def aggregate_df(df: pandas.DataFrame, metadata_keys: list[str] | None = None, u
|
|
|
271
271
|
assert_noreturn(unreachable)
|
|
272
272
|
|
|
273
273
|
index_columns = ["phase", *metadata_columns]
|
|
274
|
-
|
|
274
|
+
# `dropna=False`を指定する理由: メタデータの値はNAである可能性があるため
|
|
275
|
+
df2 = df.pivot_table(values="_aggregate_value", index=index_columns, columns="task_status_for_summary", aggfunc="sum", fill_value=0, dropna=False)
|
|
275
276
|
|
|
276
277
|
# 列数を固定する
|
|
277
278
|
for status in TaskStatusForSummary:
|
|
@@ -309,6 +310,11 @@ def aggregate_df(df: pandas.DataFrame, metadata_keys: list[str] | None = None, u
|
|
|
309
310
|
TaskStatusForSummary.COMPLETE.value,
|
|
310
311
|
]
|
|
311
312
|
df2 = df2[result_columns]
|
|
313
|
+
|
|
314
|
+
# すべてのタスクステータス列が0の行を除外
|
|
315
|
+
status_columns = [status.value for status in TaskStatusForSummary]
|
|
316
|
+
df2 = df2[df2[status_columns].sum(axis=1) > 0]
|
|
317
|
+
|
|
312
318
|
return df2
|
|
313
319
|
|
|
314
320
|
|
|
@@ -213,9 +213,9 @@ annofabcli/task/put_tasks.py,sha256=-v6JIXX0hGjwDWTkHLnRYr60hDHRg77Y86d-dfPymoo,
|
|
|
213
213
|
annofabcli/task/put_tasks_by_count.py,sha256=6i7y-aH99pEDBQRWqsEQ5ESuSOL6v0SRNl3HddxLYnM,5979
|
|
214
214
|
annofabcli/task/reject_tasks.py,sha256=lCpAfsU530O2TaYf8TbO4CeML7LoFgWwsCUCH6S_YC0,21924
|
|
215
215
|
annofabcli/task/subcommand_task.py,sha256=vZIBXsHGc0203Q3yiSrQgNjov5MPSRyNLJ2qsFepVCA,2387
|
|
216
|
-
annofabcli/task/update_metadata_of_task.py,sha256=
|
|
216
|
+
annofabcli/task/update_metadata_of_task.py,sha256=WECoFLJ_-LWdpJ1bvzDGMh459FoLUkT8gbeLDN0JCqY,12895
|
|
217
217
|
annofabcli/task_count/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
218
|
-
annofabcli/task_count/list_by_phase.py,sha256=
|
|
218
|
+
annofabcli/task_count/list_by_phase.py,sha256=7kSPW1Yn_DFvtQ1-grryEXIaqJKJsOvpGjrrQ2AoFtU,24124
|
|
219
219
|
annofabcli/task_count/subcommand_task_count.py,sha256=DDys_Qa4TxJarqSkJQB3zjQipSvGA7-WDNoN2HA-_JQ,735
|
|
220
220
|
annofabcli/task_history/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
221
221
|
annofabcli/task_history/download_task_history_json.py,sha256=mmQ0r0jGvQyeNahVeNXX8bUjOAYxP0vgBNA9Sf0QLu8,2424
|
|
@@ -227,8 +227,8 @@ annofabcli/task_history_event/download_task_history_event_json.py,sha256=lWyOoS2
|
|
|
227
227
|
annofabcli/task_history_event/list_all_task_history_event.py,sha256=yNmvIEoNkfXXWPq9JZ3eAio82CrmELPSFg2M1yRHSzo,8017
|
|
228
228
|
annofabcli/task_history_event/list_worktime.py,sha256=k6Hgy0pE2w5BtyUePN-LAyTbw0W2RMU4retwa6rC2uU,15497
|
|
229
229
|
annofabcli/task_history_event/subcommand_task_history_event.py,sha256=dFllzpm8plnnwADwTV74h-R2LOA7rZW-xd2YnSkwTHo,1229
|
|
230
|
-
annofabcli-1.114.
|
|
231
|
-
annofabcli-1.114.
|
|
232
|
-
annofabcli-1.114.
|
|
233
|
-
annofabcli-1.114.
|
|
234
|
-
annofabcli-1.114.
|
|
230
|
+
annofabcli-1.114.3.dist-info/METADATA,sha256=XVrMwYdpaFIKjnuOaivkgN6iaqHyhdEdat5dm_dfZyg,4949
|
|
231
|
+
annofabcli-1.114.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
232
|
+
annofabcli-1.114.3.dist-info/entry_points.txt,sha256=C2uSUc-kkLJpoK_mDL5FEMAdorLEMPfwSf8VBMYnIFM,56
|
|
233
|
+
annofabcli-1.114.3.dist-info/licenses/LICENSE,sha256=pcqWYfxFtxBzhvKp3x9MXNM4xciGb2eFewaRhXUNHlo,1081
|
|
234
|
+
annofabcli-1.114.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|