question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow overwriting output groups

See original GitHub issue

@bertsky wrote in #245:

(The --force option is not exposed to those CLIs.)

I often have a usage pattern of 1. force-removing an output group to 2. run a processor again, e.g.:

ocrd workspace remove-group -rf OCR-D-IMG-BINPAGE
ocrd workspace remove-group -rf OCR-D-IMG-BIN
ocrd-olena-binarize -I OCR-D-IMG -O OCR-D-IMG-BINPAGE,OCR-D-IMG-BIN \
    -p "$ocrd_olena_binarize_parameters"

or

ocrd workspace remove-group -rf OCR-D-SEG-LINE
ocrd-sbb-textline-detector -I OCR-D-IMG-BINPAGE -O OCR-D-SEG-LINE \
    -p "$ocrd_sbb_textline_detector_parameters"

It would be great if the processor CLI wrapper would provide --force to reduce this to:

ocrd-olena-binarize --force -I OCR-D-IMG -O OCR-D-IMG-BINPAGE,OCR-D-IMG-BIN \
    -p "$ocrd_olena_binarize_parameters"

and

ocrd-sbb-textline-detector --force -I OCR-D-IMG-BINPAGE -O OCR-D-SEG-LINE \
    -p "$ocrd_sbb_textline_detector_parameters"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kbacommented, Feb 13, 2020

–overwrite would overwrite the whole group if it exists (that is remove all files in the group for all pages, regardless of what pages the processor will process) –overwrite --page-id xyz would overwrite just the files for the specified page if they exist

Sounds good, I’ll go implement it this way.

first writing to a temporary output group, and if that worked without errors, replacing the output group with the new one

That would also be possible but could cause different problems with consistency and produce counterintuitive results (“I pressed Ctrl-C after 30 images but processor produced no results in the output-file-grp”).

2reactions
mikegerbercommented, Feb 13, 2020

And probably not call it --force but --overwrite because the latter is more specific.

Just ideas for the semantics:

  • --overwrite would overwrite the whole group if it exists (that is remove all files in the group for all pages, regardless of what pages the processor will process)
  • --overwrite --page-id xyz would overwrite just the files for the specified page if they exist

The first one is my use case, the latter might be useful for someone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render Tool - Setting to allow overwriting an exis...
Render Tool - Setting to allow overwriting an existing File ... File should be overwritten (Otherwise throw an error, like the Output Data ......
Read more >
Rules that overwrite inputs - Google Groups
I'm attempting to make a Bazel rule for generating the gqlgen codegen bits. I'm not the first to try, but it looks like...
Read more >
Basic Model Won't Overwrite Existing Data - Esri Community
In ArcMap, click Geoprocessing > Geoprocessing Environments. Check the first option "Allow Geoprocessing tools to overwrite existing datasets".
Read more >
override using .groups argument - Stack Overflow
I keep getting " summarise() has grouped output by 'new_brand'. You can override using the .groups argument." I'm not sure if I'm getting ......
Read more >
Geoprocessing options—ArcGIS Pro | Documentation
Allow geoprocessing tools to overwrite existing datasets. This option controls whether geoprocessing tools can overwrite existing data, layers, or files when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found