-
Notifications
You must be signed in to change notification settings - Fork 533
changing ANTS input traits, fixes #2245 #2261
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
Codecov Report
@@ Coverage Diff @@
## master #2261 +/- ##
==========================================
- Coverage 72.37% 72.32% -0.06%
==========================================
Files 1188 1183 -5
Lines 59184 59008 -176
Branches 8506 8490 -16
==========================================
- Hits 42837 42675 -162
+ Misses 14961 14949 -12
+ Partials 1386 1384 -2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #2261 +/- ##
==========================================
- Coverage 72.37% 72.32% -0.06%
==========================================
Files 1188 1183 -5
Lines 59184 59008 -176
Branches 8506 8490 -16
==========================================
- Hits 42837 42675 -162
+ Misses 14961 14949 -12
+ Partials 1386 1384 -2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #2261 +/- ##
==========================================
- Coverage 72.37% 72.32% -0.06%
==========================================
Files 1188 1184 -4
Lines 59184 59024 -160
Branches 8506 8490 -16
==========================================
- Hits 42837 42689 -148
+ Misses 14961 14953 -8
+ Partials 1386 1382 -4
Continue to review full report at Codecov.
|
@djarecka - can we use this example to add a test to regression testing framework? i feel that's what we need to do from here on out. interfaces like antsRegistration have too many options to generate all kinds of tests automatically. but we can use a combination of manual examples that actually test the binary. this obviously won't be part of the pull-request, but it would be nice to use this example as a test case in the testing framework. |
desc='the metric weight(s) for each stage. ' | ||
'The weights must sum to 1 per stage.') | ||
|
||
radius = traits.List(traits.Int(), requires=['metric'], mandatory=True, desc='') |
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.
no description added.
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.
I added some description, but originally none of the traits had any description, and most of the still don't have. I can write the description when working on tests. I guess we can keep this PR open for some time
There is any typical value that could be used as default?
@satra : ok, will work on that |
@djarecka - a mandatory trait should not have a default value in general. we leave it to the user to provide it. but there are cases when this may be necessary. i don't think this is one of them. descriptions should come from the actual command line interface. |
@satra - hmm... i used default for |
@djarecka - is this ready? or there other changes coming? |
@satra it fixes the issue (and just added a simple example that I was using to test it. However this entire file requires review and tests. Other interfaces have very similar problems. We can either keep this open or open a new one later. If no |
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.
haven't tested it out but LGTM
ants.inputs.transformation_model= "SyN" | ||
ants.inputs.moving_image = [os.path.join(datadir, 'resting.nii')] | ||
ants.inputs.fixed_image = [os.path.join(datadir, 'T1.nii')] | ||
ants.inputs.metric = [u'MI'] |
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.
can we just import unicode literals?
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.
done
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.
LGTM, couple of minor nitpicks
metric_weight = traits.List(traits.Float(), value=[1.0], usedefault=True, | ||
requires=['metric'], mandatory=True, | ||
desc='the metric weight(s) for each stage. ' | ||
'The weights must sum to 1 per stage.') |
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.
isn't this a pep8 warning?
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 line doesn't give any warning, but the files indeed violates many. will edit
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.
I will actually review pep8 only for the first part I was changing, will review pep8 for entire file together with other updates
import os | ||
import pytest | ||
|
||
def test_ants_mand(): |
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.
does the interface actually create files? if so (and I guess it would), we should include tmpdir.chdir()
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.
done
I've changed
metric_weight
(took default from other interfaces) andradius
(left without default value).Unfortunately other interfaces from that file have similar problems (do not work after providing all mandatory fields) and it was already reported in #529.
I can keep adding
mandatory
to traits and guessing default values, but it might be better for those interfaces if someone who is using them do it (or help me).