Skip to content

Commit

Permalink
blackのバージョンアップによるフォーマット (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuji38kwmt authored Feb 8, 2023
1 parent 8fe6396 commit cd54b29
Show file tree
Hide file tree
Showing 75 changed files with 80 additions and 179 deletions.
2 changes: 0 additions & 2 deletions annofabcli/annotation/change_annotation_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ def change_annotation_attributes_for_task_list(
success_count = len([e for e in result_bool_list if e])

else:

for task_index, task_id in enumerate(task_id_list):

try:
result = self.change_attributes_for_task(
task_id,
Expand Down
1 change: 0 additions & 1 deletion annofabcli/annotation/change_annotation_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def change_annotation_properties_task_list(
backup_dir: Optional[Path] = None,
parallelism: Optional[int] = None,
):

project_title = self.facade.get_project_title(self.project_id)
logger.info(f"プロジェクト'{project_title}'に対して、タスク{len(task_id_list)} 件のアノテーションのプロパティを変更します")

Expand Down
1 change: 0 additions & 1 deletion annofabcli/annotation/copy_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class CopyAnnotationMain(AbstractCommandLineWithConfirmInterface):
def __init__(
self, service: annofabapi.Resource, *, project_id: str, all_yes: bool, overwrite: bool, merge: bool, force: bool
):

self.service = service
self.project_id = project_id
self.overwrite = overwrite
Expand Down
3 changes: 0 additions & 3 deletions annofabcli/annotation/import_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ def parser_to_request_body_with_merge(
details: List[ImportedSimpleAnnotationDetail],
old_annotation: Dict[str, Any],
) -> Dict[str, Any]:

old_details = old_annotation["details"]
old_dict_detail = {}
INDEX_KEY = "_index"
Expand Down Expand Up @@ -363,7 +362,6 @@ def parser_to_request_body_with_merge(
return request_body

def put_annotation_for_input_data(self, parser: SimpleAnnotationParser) -> bool:

task_id = parser.task_id
input_data_id = parser.input_data_id

Expand Down Expand Up @@ -401,7 +399,6 @@ def put_annotation_for_input_data(self, parser: SimpleAnnotationParser) -> bool:
return True

def put_annotation_for_task(self, task_parser: SimpleAnnotationParserByTask) -> int:

logger.info(f"タスク'{task_parser.task_id}'に対してアノテーションを登録します。")

success_count = 0
Expand Down
3 changes: 0 additions & 3 deletions annofabcli/annotation/restore_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def parser_to_request_body(self, parser: SimpleAnnotationParser) -> Dict[str, An
return request_body

def put_annotation_for_input_data(self, parser: SimpleAnnotationParser) -> bool:

task_id = parser.task_id
input_data_id = parser.input_data_id

Expand All @@ -110,7 +109,6 @@ def put_annotation_for_input_data(self, parser: SimpleAnnotationParser) -> bool:
return True

def put_annotation_for_task(self, task_parser: SimpleAnnotationParserByTask) -> int:

logger.info(f"タスク'{task_parser.task_id}' のアノテーションをリストアします。")

success_count = 0
Expand Down Expand Up @@ -269,7 +267,6 @@ class RestoreAnnotation(AbstractCommandLineInterface):
COMMON_MESSAGE = "annofabcli annotation restore: error:"

def validate(self, args: argparse.Namespace) -> bool:

if args.parallelism is not None and not args.yes:
print(
f"{self.COMMON_MESSAGE} argument --parallelism: '--parallelism'を指定するときは、必ず '--yes' を指定してください。",
Expand Down
1 change: 0 additions & 1 deletion annofabcli/annotation/subcommand_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def main(

class GetAnnotationSpecsWithAttributeIdReplaced(AbstractCommandLineInterface):
def main(self):

args = self.args
project_id: str = args.project_id
super().validate_project(project_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def main(

class GetAnnotationSpecsWithAttributeIdReplaced(AbstractCommandLineInterface):
def main(self):

args = self.args
project_id: str = args.project_id
super().validate_project(project_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def main(self, annotation_specs: dict[str, Any], *, target_label_names: Optional

class GetAnnotationSpecsWithLabelIdReplaced(AbstractCommandLineInterface):
def main(self):

args = self.args
project_id: str = args.project_id
super().validate_project(project_id)
Expand Down
1 change: 0 additions & 1 deletion annofabcli/annotation_specs/list_annotation_specs_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def get_history_id_from_before_index(self, project_id: str, before: int) -> Opti
return history["history_id"]

def main(self):

args = self.args

if args.before is not None:
Expand Down
1 change: 0 additions & 1 deletion annofabcli/annotation_specs/subcommand_annotation_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/delete_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class DeleteComment(AbstractCommandLineInterface):
COMMON_MESSAGE = "annofabcli comment delete: error:"

def validate(self, args: argparse.Namespace) -> bool:

if args.parallelism is not None and not args.yes:
print(
f"{self.COMMON_MESSAGE} argument --parallelism: '--parallelism'を指定するときは、必ず '--yes' を指定してください。",
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/list_all_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def get_all_comment(
comment_type: Optional[CommentType],
exclude_reply: bool,
) -> list[dict[str, Any]]:

if comment_json is None:
downloading_obj = DownloadingFile(self.service)
with tempfile.NamedTemporaryFile() as temp_file:
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/put_comment_simply.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def put_comment_for_task_list(
comment_info: AddedSimpleComment,
parallelism: Optional[int] = None,
) -> None:

logger.info(f"{len(task_ids)} 件のタスクに{self.comment_type_name}を付与します。")

if parallelism is not None:
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/put_inspection_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class PutInspectionComment(AbstractCommandLineInterface):
COMMON_MESSAGE = "annofabcli comment put_inspection: error:"

def validate(self, args: argparse.Namespace) -> bool:

if args.parallelism is not None and not args.yes:
print(
f"{self.COMMON_MESSAGE} argument --parallelism: '--parallelism'を指定するときは、必ず '--yes' を指定してください。",
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/put_inspection_comment_simply.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@


class PutInspectionCommentSimply(AbstractCommandLineInterface):

COMMON_MESSAGE = "annofabcli comment put_inspection_simply: error:"

def validate(self, args: argparse.Namespace) -> bool:
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/put_onhold_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class PutInspectionComment(AbstractCommandLineInterface):
COMMON_MESSAGE = "annofabcli comment put_onhold: error:"

def validate(self, args: argparse.Namespace) -> bool:

if args.parallelism is not None and not args.yes:
print(
f"{self.COMMON_MESSAGE} argument --parallelism: '--parallelism'を指定するときは、必ず '--yes' を指定してください。",
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/put_onhold_comment_simply.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


class PutOnholdCommentSimply(AbstractCommandLineInterface):

COMMON_MESSAGE = "annofabcli comment put_onhold_simply: error:"

def validate(self, args: argparse.Namespace) -> bool:
Expand Down
1 change: 0 additions & 1 deletion annofabcli/comment/subcommand_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
2 changes: 0 additions & 2 deletions annofabcli/filesystem/draw_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class DrawingOptions(DataClassJsonMixin):


class DrawingAnnotationForOneImage:

_COLOR_PALETTE = [
"red",
"maroon",
Expand Down Expand Up @@ -177,7 +176,6 @@ def main(
assert image_file is not None or image_size is not None

if image_file is not None:

with Image.open(image_file) as image:
draw = ImageDraw.Draw(image)
self._draw_annotations(draw, parser)
Expand Down
2 changes: 0 additions & 2 deletions annofabcli/filesystem/filter_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def filter_annotation_zip(annotation_zip: Path, filter_query: FilterQuery, outpu
zip_filepath_dict = create_outer_filepath_dict(zip_file.namelist())
count = 0
for parser in lazy_parse_simple_annotation_zip(annotation_zip):

if not match_query(parser.load_json(), filter_query):
continue

Expand Down Expand Up @@ -201,7 +200,6 @@ def main(args):


def parse_args(parser: argparse.ArgumentParser):

parser.add_argument("--annotation", type=Path, required=True, help="アノテーションzip、またはzipを展開したディレクトリ")

parser.add_argument(
Expand Down
1 change: 0 additions & 1 deletion annofabcli/filesystem/subcommand_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers()

# サブコマンドの定義
Expand Down
2 changes: 0 additions & 2 deletions annofabcli/input_data/put_input_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def __init__(self, service: annofabapi.Resource, facade: AnnofabApiFacade, all_y
def put_input_data(
self, project_id: str, csv_input_data: InputDataForPut, last_updated_datetime: Optional[str] = None
):

request_body: Dict[str, Any] = {"last_updated_datetime": last_updated_datetime}

file_path = get_file_scheme_path(csv_input_data.input_data_path)
Expand Down Expand Up @@ -184,7 +183,6 @@ def confirm_put_input_data(self, input_data: InputDataForPut, already_exists: bo
return self.confirm_processing(message_for_confirm)

def put_input_data_main(self, project_id: str, csv_input_data: CsvInputData, overwrite: bool = False) -> bool:

input_data = InputDataForPut(
input_data_name=csv_input_data.input_data_name,
input_data_path=csv_input_data.input_data_path,
Expand Down
1 change: 0 additions & 1 deletion annofabcli/input_data/subcommand_input_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def get_inspection_comment_list(
only_reply: bool,
exclude_reply: bool,
) -> List[Inspection]:

if inspection_comment_json is None:
downloading_obj = DownloadingFile(self.service)
cache_dir = annofabcli.common.utils.get_cache_dir()
Expand Down
1 change: 0 additions & 1 deletion annofabcli/inspection_comment/list_inspections.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def get_inspections(
input_data_id_list = task["input_data_id_list"]
logger.info(f"タスク '{task_id}' に紐づく検査コメントを取得します。input_dataの個数 = {len(input_data_id_list)}")
for input_data_index, input_data_id in enumerate(input_data_id_list):

inspections = self.get_inspections_by_input_data(
project_id, task_id, input_data_id, input_data_index
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/instruction/list_instruction_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def main(args):


def parse_args(parser: argparse.ArgumentParser):

argument_parser = ArgumentParser(parser)

argument_parser.add_project_id()
Expand Down
1 change: 0 additions & 1 deletion annofabcli/instruction/subcommand_instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/job/subcommand_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/my_account/subcommand_my_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/organization/subcommand_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/project/change_project_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def main(args):


def parse_args(parser: argparse.ArgumentParser):

parser.add_argument(
"-p",
"--project_id",
Expand Down
1 change: 0 additions & 1 deletion annofabcli/project/put_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def put_project(
overview: Optional[str],
plugin_id: Optional[str],
):

new_project_id = project_id if project_id is not None else str(uuid.uuid4())

request_body = {
Expand Down
1 change: 0 additions & 1 deletion annofabcli/project/subcommand_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/project_member/subcommand_project_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
1 change: 0 additions & 1 deletion annofabcli/stat_visualization/mask_visualization_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def main(args):


def parse_args(parser: argparse.ArgumentParser):

parser.add_argument(
"--dir",
type=Path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


def parse_args(parser: argparse.ArgumentParser):

subparsers = parser.add_subparsers(dest="subcommand_name")

# サブコマンドの定義
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def main(args):


def parse_args(parser: argparse.ArgumentParser):

parser.add_argument(
"--dir",
type=Path,
Expand Down
2 changes: 0 additions & 2 deletions annofabcli/stat_visualization/write_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def write_line_graph(self, task: Task):
)

def main(self):

try:
# メンバのパフォーマンスを散布図で出力する
self.output_project_dir.write_user_performance_scatter_plot(self.project_dir.read_user_performance())
Expand Down Expand Up @@ -122,7 +121,6 @@ def main(args):


def parse_args(parser: argparse.ArgumentParser):

parser.add_argument(
"--dir",
type=Path,
Expand Down
Loading

0 comments on commit cd54b29

Please sign in to comment.