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

Use logging instead of print statements #1862

Merged
merged 27 commits into from Dec 19, 2019
Merged

Conversation

arokem
Copy link
Contributor

@arokem arokem commented Jun 19, 2019

Also removing "from future" imports along the way.

@skoudoro
Copy link
Member

skoudoro commented Jul 8, 2019

Overall this PR looks good to me. I see a WIP on your title, are there other files that you want to update?

@arokem arokem changed the title WIP: Use logging instead of print statements Use logging instead of print statements Jul 8, 2019
@codecov-io
Copy link

codecov-io commented Jul 10, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@22b015e). Click here to learn what that means.
The diff coverage is 79.16%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1862   +/-   ##
=========================================
  Coverage          ?   91.12%           
=========================================
  Files             ?      243           
  Lines             ?    31252           
  Branches          ?     3273           
=========================================
  Hits              ?    28478           
  Misses            ?     2041           
  Partials          ?      733
Impacted Files Coverage Δ
dipy/core/tests/test_sphere.py 65.04% <ø> (ø)
dipy/core/rng.py 46.34% <ø> (ø)
dipy/align/tests/test_imwarp.py 99.22% <ø> (ø)
dipy/core/graph.py 73.49% <ø> (ø)
dipy/denoise/tests/test_noise_estimate.py 100% <ø> (ø)
dipy/data/__init__.py 81.69% <ø> (ø)
dipy/core/sphere.py 93.87% <ø> (ø)
dipy/core/onetime.py 89.47% <ø> (ø)
dipy/core/sphere_stats.py 58.33% <ø> (ø)
dipy/core/ndindex.py 76.92% <ø> (ø)
... and 7 more

@@ -39,9 +39,9 @@ class FetcherError(Exception):

def _log(msg):
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want to keep this function? Since you are using logging module, you should delete it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's useful as shorthand. I just pushed a clarification of the docstring.

@arokem
Copy link
Contributor Author

arokem commented Jul 10, 2019

Now also rebased.

@pep8speaks
Copy link

pep8speaks commented Jul 11, 2019

Hello @arokem, Thank you for updating !

Line 127:81: E501 line too long (82 > 80 characters)

Comment last updated at 2019-12-19 17:34:36 UTC

@arokem
Copy link
Contributor Author

arokem commented Jul 11, 2019

I'm also taking the opportunity to remove verbose settings, because I believe this should be set by the logging level. Would this break something else?

@skoudoro
Copy link
Member

I think we should keep verbose. We just need to improve it and do like the registration module. Look at dipy.align.imwarp

@skoudoro
Copy link
Member

skoudoro commented Sep 4, 2019

Hi @arokem, What is your status on this PR? it looks close to being done!

@arokem
Copy link
Contributor Author

arokem commented Sep 4, 2019

Just rebased. IIUC, the main thing that needs to be done is reinstating verbose setting?

@skoudoro
Copy link
Member

skoudoro commented Sep 4, 2019

Yes, I think so

@arokem
Copy link
Contributor Author

arokem commented Sep 5, 2019

OK. I believe that I have restored the verbose flag everywhere we previously had it. I still think that this is something that is best handled by having the users set their logging levels, but we can also do that later if y'all end up agreeing with me.

@arokem
Copy link
Contributor Author

arokem commented Sep 7, 2019

I believe that this ready for a re-review. Codecov is just being dumb.

@arokem
Copy link
Contributor Author

arokem commented Sep 24, 2019

@arokem will look into nicer printing options for logging

@arokem
Copy link
Contributor Author

arokem commented Sep 25, 2019

Some more thoughts about logging: https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/

@skoudoro
Copy link
Member

Is there anything you want to add? I forgot what we said during the last online meeting concerning this PR but it looks ready to be merged for me. Maybe, the logging "design/string format" can be done on a new PR. What do you think?

@arokem
Copy link
Contributor Author

arokem commented Oct 15, 2019

Ready on my end. @Garyfallidis : have you had a chance to think about this more?

@skoudoro
Copy link
Member

skoudoro commented Nov 4, 2019

can you rebase this one or resolve the conflict @arokem?

@arokem
Copy link
Contributor Author

arokem commented Nov 7, 2019

Rebased!

@skoudoro
Copy link
Member

skoudoro commented Nov 8, 2019

Thank you @arokem! Any other comments? will merge it by the end of the week

@Garyfallidis
Copy link
Contributor

Hello @arokem. Sorry can you rebase this one more time? Will look into merging the following days.

@arokem
Copy link
Contributor Author

arokem commented Dec 19, 2019 via email

@Garyfallidis Garyfallidis merged commit 3bff9cf into dipy:master Dec 19, 2019
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.

None yet

5 participants