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 absolute import in imaffine, imwarp, metrics #975

Closed
sahmed95 opened this Issue Mar 19, 2016 · 8 comments

Comments

Projects
None yet
4 participants
@sahmed95
Contributor

sahmed95 commented Mar 19, 2016

Refer to issue #969
Change relative imports to absolute imports in .py files inside dipy/dipy/

/dipy/dipy/align/imaffine.py:
   46  import numpy.linalg as npl
   47  import scipy.ndimage as ndimage
   48: from ..core.optimize import Optimizer
   49: from ..core.optimize import SCIPY_LESS_0_12
   50: from . import vector_fields as vf
   51: from . import VerbosityLevels
   52: from .parzenhist import (ParzenJointHistogram,
   53                           sample_domain_regular,
   54                           compute_parzen_mi)
   55: from .imwarp import (get_direction_and_spacings, ScaleSpace)
   56: from .scalespace import IsotropicScaleSpace
   57  from warnings import warn
   58  
/dipy/dipy/align/imwarp.py:
    8  import scipy as sp
    9  import nibabel as nib
   10: from . import vector_fields as vfu
   11: from . import floating
   12: from . import VerbosityLevels
   13: from . import Bunch
   14: from .scalespace import ScaleSpace

/dipy/dipy/align/metrics.py:
    6  import scipy as sp
    7  from scipy import gradient, ndimage
    8: from ..utils.six import with_metaclass
    9: from . import vector_fields as vfu
   10: from . import sumsqdiff as ssd
   11: from . import crosscorr as cc
   12: from . import expectmax as em
   13: from . import floating
@riddhishb

This comment has been minimized.

Contributor

riddhishb commented Mar 19, 2016

I would like to work on this issue

@riddhishb

This comment has been minimized.

Contributor

riddhishb commented Mar 19, 2016

The corresponding test codes also have the relative import issues
/dipy/dipy/align/tests/test_imwarp.py
and
/dipy/dipy/align/tests/test_metrics.py

fixing those too

@sahmed95

This comment has been minimized.

Contributor

sahmed95 commented Mar 19, 2016

Hi @riddhishb Thanks for taking a look. You can find a complete list here: http://paste.ubuntu.com/15386849/

I am discussing with dipy developers and will open separate issues for all the cases.
Note: @Garyfallidis pointed out that only the ".py" files in dipy/dipy have to be changed. Leave the .pyx files unchanged.

@riddhishb

This comment has been minimized.

Contributor

riddhishb commented Mar 19, 2016

Yeah sure thing :) I saw the gitter chats.
Thats quite a long list, if you want help in creating the separate cases for them, let me know.
here have a look before I make a PR
master...riddhishb:relative_import_fix

@sahmed95

This comment has been minimized.

Contributor

sahmed95 commented Mar 19, 2016

LGTM. Let someone from dipy review. Btw check this line. The indention is not matching with the next line and this might be a pep8 issue.

@riddhishb

This comment has been minimized.

Contributor

riddhishb commented Mar 19, 2016

Good catch! will correct and make the pr

@theaverageguy

This comment has been minimized.

Contributor

theaverageguy commented Mar 21, 2016

This can be closed I guess.

@arokem

This comment has been minimized.

Member

arokem commented Mar 21, 2016

Closed by #977

@arokem arokem closed this Mar 21, 2016

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