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

Projects
None yet
4 participants
@zuphilip
Copy link
Collaborator

zuphilip commented Dec 19, 2017

sources[:,:] = None
dists = 99999*ones((m+1,n+1))
dists[0,:] = arange(n+1)
dists = 99999*np.ones((m+1,n+1))

This comment has been minimized.

@QuLogic

QuLogic Dec 19, 2017

Contributor

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

This comment has been minimized.

@zuphilip

zuphilip Dec 20, 2017

Author Collaborator

Thank you!

@amitdo

This comment has been minimized.

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

This comment has been minimized.

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 zuphilip force-pushed the zuphilip:edist-py-imports branch from ea584d0 to 5a71411 Dec 19, 2017

@zuphilip

This comment has been minimized.

Copy link
Collaborator Author

zuphilip commented Dec 19, 2017

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

@amitdo

This comment has been minimized.

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

zuphilip added some commits Dec 27, 2017

Standardize imports for lineest.py, psegutils.py #176
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
Standardize numpy imports in more files #176
These replacements are easy.

@zuphilip zuphilip force-pushed the zuphilip:edist-py-imports branch from dfb5a54 to bfb001d Dec 27, 2017

@zuphilip

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

kba commented Feb 19, 2018

numpy should be np in 23ebc40 @zuphilip

@zuphilip zuphilip merged commit d3e5cc6 into tmbdev:master Feb 19, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@zuphilip zuphilip deleted the zuphilip:edist-py-imports branch Feb 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment