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

PageType.get_AllRegions to list all kinds of regions #479

Merged
merged 36 commits into from
Jun 4, 2020

Conversation

kba
Copy link
Member

@kba kba commented May 13, 2020

First step to have a type-agnostic listing of all Regions, Text-, Table-, Graphics- etc.

Currently only available on the Page element, ordering by reading order not yet implemeneted. Is now implemented.

#240 (comment)

Since we've been adding a few methods to the generateDS code now, I've refactored the code so that the methods can be defined in their own file with proper syntax highlighting etc..

@kba kba requested a review from bertsky May 13, 2020 18:47
@codecov-io
Copy link

codecov-io commented May 13, 2020

Codecov Report

Merging #479 into master will decrease coverage by 0.08%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #479      +/-   ##
==========================================
- Coverage   80.10%   80.02%   -0.09%     
==========================================
  Files          40       40              
  Lines        2388     2393       +5     
  Branches      442      444       +2     
==========================================
+ Hits         1913     1915       +2     
- Misses        403      406       +3     
  Partials       72       72              
Impacted Files Coverage Δ
ocrd_models/ocrd_models/ocrd_page.py 100.00% <ø> (ø)
ocrd_models/ocrd_page_user_methods.py 0.00% <0.00%> (ø)
ocrd_models/ocrd_models/ocrd_mets.py 94.67% <0.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42c1672...e1740f7. Read the comment docs.

Copy link
Collaborator

@bertsky bertsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

(But maybe first #478 should be fixed.)

ocrd_models/ocrd_page_user_methods.py Outdated Show resolved Hide resolved
ocrd_models/ocrd_page_user_methods.py Outdated Show resolved Hide resolved
ocrd_models/ocrd_page_user_methods.py Outdated Show resolved Hide resolved
Co-authored-by: Robert Sachunsky <38561704+bertsky@users.noreply.github.com>
@kba kba force-pushed the get-all-regions branch from b728885 to 3445f87 Compare May 14, 2020 13:26
ocrd_models/ocrd_models/ocrd_page_generateds.py Outdated Show resolved Hide resolved
ocrd_models/ocrd_models/ocrd_page_generateds.py Outdated Show resolved Hide resolved
ocrd_models/README.md Outdated Show resolved Hide resolved
ocrd_models/ocrd_page_user_methods.py Show resolved Hide resolved
ocrd_models/README.md Outdated Show resolved Hide resolved
ocrd_models/README.md Show resolved Hide resolved
Copy link
Collaborator

@bertsky bertsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal to get recursion (with both finite or arbitrary depth) – not tested!

ocrd_models/ocrd_page_user_methods/get_AllRegions.py Outdated Show resolved Hide resolved
ocrd_models/ocrd_page_user_methods/get_AllRegions.py Outdated Show resolved Hide resolved
ocrd_models/ocrd_page_user_methods/get_AllRegions.py Outdated Show resolved Hide resolved
Co-authored-by: Robert Sachunsky <38561704+bertsky@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented May 28, 2020

Codecov Report

Merging #479 into master will decrease coverage by 0.09%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #479      +/-   ##
==========================================
- Coverage   79.71%   79.62%   -0.10%     
==========================================
  Files          41       41              
  Lines        2490     2493       +3     
  Branches      477      478       +1     
==========================================
  Hits         1985     1985              
- Misses        417      420       +3     
  Partials       88       88              
Impacted Files Coverage Δ
ocrd_models/ocrd_page_user_methods.py 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d6f780...b79474a. Read the comment docs.

kba and others added 5 commits May 28, 2020 13:40
Co-authored-by: Robert Sachunsky <38561704+bertsky@users.noreply.github.com>
Co-authored-by: Robert Sachunsky <38561704+bertsky@users.noreply.github.com>
Co-authored-by: Robert Sachunsky <38561704+bertsky@users.noreply.github.com>
@kba
Copy link
Member Author

kba commented May 28, 2020

@bertsky I've merged your proposals, refactored the inner functions to methods. Can you take a look and make sure I didn't botch the merge?

@wrznr @tboenig @cneud Can you weigh in on the @index consistency / "regions-not-listed-in-reading-order issue above, so we can finish and merge this soon?

kba and others added 2 commits May 28, 2020 16:09
ocrd_models/ocrd_page_user_methods/get_AllRegions.py Outdated Show resolved Hide resolved
tests/model/test_ocrd_page.py Show resolved Hide resolved
tests/model/test_ocrd_page.py Show resolved Hide resolved
Copy link
Collaborator

@bertsky bertsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe CHANGELOG.md needs to be updated. Also, we could try to advertise the new API a little, e.g. in ocrd_models/README.md (or even up in core/README.md)...

ocrd_models/ocrd_page_user_methods/get_AllRegions.py Outdated Show resolved Hide resolved
tests/model/test_ocrd_page.py Show resolved Hide resolved
Copy link
Collaborator

@bertsky bertsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splendid! Nothing left to be desired for a new (simpler + more powerful) generation of processors.

kba and others added 2 commits June 3, 2020 14:08
Co-authored-by: Robert Sachunsky <38561704+bertsky@users.noreply.github.com>
@kba kba merged commit b79474a into OCR-D:master Jun 4, 2020
@kba kba deleted the get-all-regions branch June 4, 2020 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants