Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ocrd_network client run argument order #1303

Merged
merged 6 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ocrd/decorators/ocrd_cli_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

def ocrd_cli_options(f):
"""
Implement MP CLI.
Implement Processor CLI.

Usage::

import ocrd_click_cli from ocrd.utils
from ocrd.decorators import ocrd_cli_options

@click.command()
@ocrd_click_cli
def cli(mets_url):
print(mets_url)
@ocrd_cli_options
def cli(**kwargs):
print(kwargs['mets_url'])
"""
# XXX Note that the `--help` output is statically generate_processor_help
params = [
Expand Down
2 changes: 1 addition & 1 deletion src/ocrd/processor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def process_workspace(self, workspace: Workspace) -> None:

if max_workers > 1:
executor_cls = ProcessPoolExecutor
log_queue = mp.Queue()
log_queue = mp.get_context('fork').Queue()
else:
executor_cls = DummyExecutor
log_queue = None
Expand Down
2 changes: 0 additions & 2 deletions src/ocrd/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,6 @@ def image_from_page(self, page, page_id,
raise Exception('Found no AlternativeImage that satisfies all requirements ' +
'filter="%s" in page "%s"' % (
feature_filter, page_id))
page_image.format = 'PNG' # workaround for tesserocr#194
# ensure DPI will be set in image meta-data again
if 'DPI' in page_coords:
dpi = page_coords['DPI']
Expand Down Expand Up @@ -1060,7 +1059,6 @@ def image_from_segment(self, segment, parent_image, parent_coords,
raise Exception('Found no AlternativeImage that satisfies all requirements ' +
'filter="%s" in segment "%s"' % (
feature_filter, segment.id))
segment_image.format = 'PNG' # workaround for tesserocr#194
# ensure DPI will be set in image meta-data again
if 'DPI' in segment_coords:
dpi = segment_coords['DPI']
Expand Down
2 changes: 1 addition & 1 deletion src/ocrd_network/cli/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def check_processing_job_status(address: Optional[str], processing_job_id: str):
@click.option('-p', '--print-state', default=False, is_flag=True,
help='If set, the client will print job states by each iteration.')
def send_processing_job_request(
address: Optional[str],
processor_name: str,
address: Optional[str],
mets: str,
input_file_grp: str,
output_file_grp: Optional[str],
Expand Down
2 changes: 1 addition & 1 deletion src/ocrd_utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def raw_value(self, name):
default=(True, 128))

config.add('OCRD_MAX_PARALLEL_PAGES',
description="Maximum number of processor threads for page-parallel processing (within each Processor's selected page range, independent of the number of Processing Workers or Processor Servers). If set >1, then a METS Server must be used for METS synchronisation.",
description="Maximum number of processor workers for page-parallel processing (within each Processor's selected page range, independent of the number of Processing Workers or Processor Servers). If set >1, then a METS Server must be used for METS synchronisation.",
parser=int,
default=(True, 1))

Expand Down
Loading