-
Notifications
You must be signed in to change notification settings - Fork 536
Evaluation algorithms separated from misc #830
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
Conversation
Created a new nipype.algorithms.eval group for methods performing simple error, distance or similitude computations over images. I think this is better than having them mixed up with, e.g., nifti or csv files management. I also add a new interface: ErrorMap, that computes a distance function between two images (e.g. two displacement fields). Several metrics will be available, however now I contribute only with squared differences maps.
Tests are failing because they were not migrated (to-do) |
Thanks, could you fix the tests? Is the API backwards compatible? |
Sure, I'll fix the tests ASAP. Regarding compatibility, the interfaces moved from misc are exactly as they were at master. I just add this ErrorMap interface, which works pretty similarly to the existing ones. |
@chrisfilo I think I fixed the tests, however travis does not pass for python 2.6 (I don't know why). |
The 2.6 failure is unrelated. Two more things, mention the new interface in CHANGES, cover the case when user wants to import nipype.algorithms.misc.Distance with an deprecated warning. Thanks in advance! |
@@ -28,6 +28,10 @@ | |||
|
|||
from .. import logging | |||
|
|||
from .. import warnings | |||
warnings.warn('Evaluation interfaces (Distance, Overlap, FuzzyOverlap) | |||
have been moved to nipype.algorithms.eval' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be shown each time someone imports anything from misc. Would there be a way for people to still be able to import (Distance, Overlap, FuzzyOverlap) from misc but get a warning when they do that, but not get a warning when they import anything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also could we maintain backward compatibility for one release (@chrisfilo this should be 0.10 not 1.0 yet) and then deprecate the following release. this warning should change to a DeprecationWarning
and import these interfaces from .eval import ...
if we really wanted to give the warning only when someone imports from misc, we would have to add dummy classes, something like:
(also could rename eval to metrics?)
import nipype.algorithms.metrics as nam
class Distance (nam.Distance):
DeprecationWarning(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for backward compatibility!
On Tue, May 27, 2014 at 1:36 PM, Satrajit Ghosh notifications@github.comwrote:
In nipype/algorithms/misc.py:
@@ -28,6 +28,10 @@
from .. import logging
+from .. import warnings
+warnings.warn('Evaluation interfaces (Distance, Overlap, FuzzyOverlap)
have been moved to nipype.algorithms.eval' )
also could we maintain backward compatibility for one release (@chrisfilohttps://github.com/chrisfilothis should be 0.10 not 1.0 yet) and then deprecate the following release.
this warning should change to a DeprecationWarning and import these
interfaces from .eval import ...if we really wanted to give the warning only when someone imports from
misc, we would have to add dummy classes, something like:(also could rename eval to metrics?)
import nipype.algorithms.metrics as nam
class Distance (nam.Distance):
DeprecationWarning(...)—
Reply to this email directly or view it on GitHubhttps://github.com//pull/830/files#r13072770
.
Ok, no problem. I will update ASAP |
Ok, it's backwards compatible now. Eval renamed to metrics. I've included the warnings in the constructor, so they are called only when you are actually using the interface. The warnings are DeprecationWarnings, so they are ignored by default (just to mention it). |
Also fixed constructor of old interface to throw the DeprecationWarning
Additionally, docstrings have been improved for several methods, especially indicating deprecated classes.
Now it uses numpy.linalg.norm
Evaluation algorithms separated from misc
Created a new nipype.algorithms.eval module for methods performing
error, distance or similitude computations over images.
I think this is better than having them mixed up with, e.g.,
nifti or csv files management.
I also add a new interface: ErrorMap, that computes a distance
function between two images (e.g. two displacement fields). Several
metrics will be available, however now I contribute only with
squared differences maps.