Skip to content

Commit

Permalink
[app][rfct] extract workflow module
Browse files Browse the repository at this point in the history
  • Loading branch information
M3ssman committed Jun 14, 2024
1 parent a1ff261 commit a397188
Show file tree
Hide file tree
Showing 13 changed files with 775 additions and 407 deletions.
2 changes: 1 addition & 1 deletion cli_dir_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
proc_type = CFG.get(odem.CFG_SEC_OCR, 'workflow_type', fallback=None)
if proc_type is None:
LOGGER.warning("no 'workflow_type' config option in section ocr defined. defaults to 'OCRD_PAGE_PARALLEL'")
PROCESS: odem.ODEMProcess = odem.ODEMProcess.create(proc_type, None, req_dst_dir, EXECUTORS)
PROCESS: odem.ODEMProcessImpl = odem.ODEMProcessImpl.create(proc_type, None, req_dst_dir, EXECUTORS)
PROCESS.local_mode = True
PROCESS.odem_configuration = CFG
PROCESS.the_logger = LOGGER
Expand Down
2 changes: 1 addition & 1 deletion cli_mets_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
if proc_type is None:
LOGGER.warning("no 'workflow_type' config option in section ocr defined. defaults to 'OCRD_PAGE_PARALLEL'")
record = df.OAIRecord(local_ident)
odem_process: odem.ODEMProcess = odem.ODEMProcess(record, mets_file_dir)
odem_process: odem.ODEMProcessImpl = odem.ODEMProcessImpl(record, mets_file_dir)
odem_process.the_logger = LOGGER
odem_process.the_logger.info("[%s] odem from %s, %d executors", local_ident, mets_file, EXECUTORS)
odem_process.odem_configuration = CFG
Expand Down
2 changes: 1 addition & 1 deletion cli_oai_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def oai_arg_parser(value):
rec_ident = record.identifier
local_ident = record.local_identifier
req_dst_dir = os.path.join(LOCAL_WORK_ROOT, local_ident)
odem_process: odem.ODEMProcess = odem.ODEMProcess(record, req_dst_dir)
odem_process: odem.ODEMProcessImpl = odem.ODEMProcessImpl(record, req_dst_dir)
odem_process.the_logger = LOGGER
odem_process.the_logger.debug(
"request %s from %s (%s part slots)",
Expand Down
4 changes: 2 additions & 2 deletions cli_oai_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MARK_OCR_DONE,
MARK_OCR_OPEN,
MARK_OCR_FAIL,
ODEMProcess,
ODEMProcessImpl,
ODEMException,
get_configparser,
get_logger,
Expand Down Expand Up @@ -156,7 +156,7 @@ def wrap_save_record_state(status: str, urn, **kwargs):
proc_type = CFG.get(odem.CFG_SEC_OCR, 'workflow_type', fallback=None)
if proc_type is None:
LOGGER.warning("no 'workflow_type' config option in section ocr defined. defaults to 'OCRD_PAGE_PARALLEL'")
odem_process: ODEMProcess = ODEMProcess(record, req_dst_dir)
odem_process: ODEMProcessImpl = ODEMProcessImpl(record, req_dst_dir)
odem_process.the_logger = LOGGER
odem_process.the_logger.info("[%s] odem from %s, %d executors", local_ident, OAI_RECORD_FILE, EXECUTORS)
odem_process.odem_configuration = CFG
Expand Down
8 changes: 4 additions & 4 deletions lib/odem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Public ODEM API"""

from .odem_commons import *

from .ocrd3_odem import (
OdemWorkflowProcessType,
ODEMProcess,
ODEMWorkflow,
ODEMProcessImpl,
)
from .ocr.ocr_workflow import (
ODEMWorkflowRunner,
ODEMWorkflow,
OCRDPageParallel,
ODEMTesseract,
)
Expand Down
Loading

0 comments on commit a397188

Please sign in to comment.