Skip to content
Snippets Groups Projects
Commit fd021209 authored by Martin's avatar Martin
Browse files

fix linting

parent 0497ee41
No related branches found
No related tags found
1 merge request!22Add style filter (handwritten, typewritten); support ignored_classes
Pipeline #74330 passed
......@@ -104,7 +104,9 @@ class HTRDataGenerator:
self.extraction_mode = extraction
self.accepted_classes = accepted_classes
self.ignored_classes = ignored_classes
self.should_filter_by_class = bool(self.accepted_classes) or bool(self.ignored_classes)
self.should_filter_by_class = bool(self.accepted_classes) or bool(
self.ignored_classes
)
self.accepted_worker_version_ids = accepted_worker_version_ids
self.should_filter_by_worker = bool(self.accepted_worker_version_ids)
self.style = style
......@@ -852,7 +854,6 @@ def create_parser():
help="List of ignored ml_class names. Filter lines by class",
)
parser.add_argument(
"--accepted_classes",
nargs="*",
......@@ -924,7 +925,9 @@ def main():
)
if args.style and (args.accepted_classes or args.ignored_classes):
if set(STYLE_CLASSES) & (set(args.accepted_classes) | set(args.ignored_classes)):
if set(STYLE_CLASSES) & (
set(args.accepted_classes) | set(args.ignored_classes)
):
parser.error(
f"--style class values ({STYLE_CLASSES}) shouldn't be in the accepted_classes list "
f"(or ignored_classes list) "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment