Skip to content

[REF] Fix use of logging module in utils, algorithms and interfaces. #2276

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

Merged
merged 5 commits into from
Nov 13, 2017

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Nov 12, 2017

Partially addresses #1242.

Changes proposed in this pull request

  • Switch from string formatting to using string format arguments as logging function parameters.

I went through nipype.utils, nipype.algorithms, and nipype.interfaces, fixing the logging calls where I found them.

Fix logging formatting in ants, cmtk, elastic, freesurfer, fsl, mrtrix,
mrtrix3, nilearn, and spm interfaces. Okay, it was mostly in cmtk, io,
and mrtrix.

- In nipype/interfaces/io.py logging is imported multiple times, and
iflogger is redefined a couple of times. Not sure if that’s the right
way to go.

- Is this okay:
    - `iflogger.debug('saving inputs {}', inputs)`
(nipype/interfaces/base.py#L1210)

- Also caught a couple of things in nipype/interfaces/cmtk/nx.py.
Namely a couple of unused variables and at one point redefining `file`.
@codecov-io
Copy link

codecov-io commented Nov 12, 2017

Codecov Report

Merging #2276 into master will not change coverage.
The diff coverage is 19.86%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2276   +/-   ##
=======================================
  Coverage   72.52%   72.52%           
=======================================
  Files        1188     1188           
  Lines       59134    59134           
  Branches     8506     8506           
=======================================
  Hits        42889    42889           
  Misses      14859    14859           
  Partials     1386     1386
Flag Coverage Δ
#smoketests 72.52% <19.86%> (ø) ⬆️
#unittests 70.15% <19.86%> (ø) ⬆️
Impacted Files Coverage Δ
nipype/interfaces/ants/registration.py 72.86% <ø> (ø) ⬆️
nipype/interfaces/dipy/tensors.py 39.72% <0%> (ø) ⬆️
nipype/interfaces/cmtk/cmtk.py 18.77% <0%> (ø) ⬆️
nipype/interfaces/cmtk/parcellation.py 14.46% <0%> (ø) ⬆️
nipype/interfaces/dipy/reconstruction.py 29.64% <0%> (ø) ⬆️
nipype/interfaces/cmtk/nx.py 19.44% <0%> (+0.04%) ⬆️
nipype/interfaces/freesurfer/preprocess.py 65.81% <0%> (ø) ⬆️
nipype/interfaces/dipy/preprocess.py 23.97% <0%> (ø) ⬆️
nipype/interfaces/dipy/tracks.py 29.51% <0%> (ø) ⬆️
nipype/interfaces/mrtrix/convert.py 21.27% <0%> (ø) ⬆️
... and 19 more

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 b443e47...ab91510. Read the comment docs.

@satra
Copy link
Member

satra commented Nov 12, 2017

@tsalo - there is one conflict due to a merge? could you please resolve and update this PR?

@satra satra merged commit ca91455 into nipy:master Nov 13, 2017
@tsalo tsalo deleted the logger branch November 13, 2017 15:09
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.

3 participants