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

Standardize imports II, #176 #282

Merged
merged 6 commits into from
Feb 19, 2018

Conversation

zuphilip
Copy link
Collaborator

@zuphilip zuphilip commented Dec 19, 2017

ocrolib/edist.py Outdated
sources[:,:] = None
dists = 99999*ones((m+1,n+1))
dists[0,:] = arange(n+1)
dists = 99999*np.ones((m+1,n+1))
Copy link
Contributor

Choose a reason for hiding this comment

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

np.full((m + 1, n + 1), 99999)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you!

@amitdo
Copy link
Contributor

amitdo commented Dec 19, 2017

In lstm.py this form is used:

from numpy import (...)

This patch uses the np namespace.

Why the difference?

@QuLogic
Copy link
Contributor

QuLogic commented Dec 19, 2017

This one is a de facto standard; I dunno why lstm was changed the other way.

@zuphilip
Copy link
Collaborator Author

Agree on what @QuLogic says, see also #206.

@amitdo
Copy link
Contributor

amitdo commented Dec 20, 2017

I don't have a problem with using the np namespace, but just wanted to point to the inconsistency.

@zuphilip zuphilip changed the title Standardize imports for edist.py #176 Standardize imports II, #176 Dec 27, 2017
Both files are covered good by the current tests and
all tests are still fine with these changes.

This work is heavily based on the work by @QuLogic in the branch
https://github.com/QuLogic/ocropy/commits/standard-import
@zuphilip
Copy link
Collaborator Author

zuphilip commented Dec 27, 2017

Please have a look at the new version of this PR. This should be ready to review now.

(There are more files where the imports could be standardized, but maybe we can first make better tests for them. This could be done in some future PRs.)

@kba
Copy link
Collaborator

kba commented Feb 19, 2018

numpy should be np in 23ebc40 @zuphilip

@zuphilip zuphilip merged commit d3e5cc6 into ocropus-archive:master Feb 19, 2018
@zuphilip zuphilip deleted the edist-py-imports branch February 19, 2018 21:04
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