Skip to content

[FIX] Bug fixes for afni.model #2398

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 2 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion nipype/interfaces/afni/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,14 @@ def _list_outputs(self):
outputs['x1D'] = self._gen_fname(
suffix='.xmat.1D', **_gen_fname_opts)

if isdefined(self.inputs.cbucket):
outputs['cbucket'] = os.path.abspath(self.inputs.cbucket)

outputs['reml_script'] = self._gen_fname(
suffix='.REML_cmd', **_gen_fname_opts)
# remove out_file from outputs if x1d_stop set to True
if self.inputs.x1D_stop:
del outputs['out_file']
del outputs['out_file'], outputs['cbucket']
Copy link
Member

Choose a reason for hiding this comment

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

if I may, test_extra_Deconvolve.py could be extended to check for the removal of outputs['cbucket']

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing this, @mvdoc ! It sounds like a new release is imminent, but if @effigies doesn't mind me using a circle cycle I'll submit a patch to extend the test.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@emdupre nothing is building right now and won't probably merge anything more. feel free to use circle, we can always cancel.

Copy link
Member

Choose a reason for hiding this comment

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

Was going to say what @djarecka said. CI is not really the submitter's problem and we can cancel and restart as needed. I just try to give a heads up when doing that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, thanks for clarifying !

else:
outputs['out_file'] = os.path.abspath(self.inputs.out_file)

Expand Down Expand Up @@ -652,3 +655,12 @@ class Synthesize(AFNICommand):
_cmd = '3dSynthesize'
input_spec = SynthesizeInputSpec
output_spec = AFNICommandOutputSpec

def _list_outputs(self):
outputs = self.output_spec().get()

for key in outputs.keys():
if isdefined(self.inputs.get()[key]):
outputs[key] = os.path.abspath(self.inputs.get()[key])

return outputs
3 changes: 2 additions & 1 deletion nipype/interfaces/afni/tests/test_extra_Deconvolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ def test_x1dstop():
deconv.inputs.out_file = 'file.nii'
assert 'out_file' in deconv._list_outputs()
deconv.inputs.x1D_stop = True
assert not 'out_file' in deconv._list_outputs()
assert 'out_file' not in deconv._list_outputs()
assert 'cbucket' not in deconv._list_outputs()