Skip to content

Create brainsuite.py #1305

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 29 commits into from
Apr 6, 2016
Merged

Create brainsuite.py #1305

merged 29 commits into from
Apr 6, 2016

Conversation

jason-wg
Copy link
Contributor

I created an interface for Brainsuite's command line tools. I'd like it to be included in nipype builds installed per the instructions on the nipype website.

I created an interface for Brainsuite's command line tools. I'd like it to be included in nipype builds installed per the instructions on the nipype website.
@satra
Copy link
Member

satra commented Dec 22, 2015

it would be good to run a PEP8 checker on this code. also in many cases you can use the simpler form for instantiating names of outputs using name_source and name_template as shown here:

http://nipy.org/nipype/devel/cmd_interface_devel.html#creating-outputs-on-the-fly

When I tried running this code, type(outputs[key]) was never == list or == str, so the method, self.s3tolocal, never got called.
When I tried debugging, type(outputs[key]) turned out to be <type 'unicode'>
I updated the formatting to comply with the PEP8 style guide (The exception is that some lines run over 79 characters)

As for instantiating names, the reason I approached it this way is to shorten the names of outputs that ran through multiple steps of processing using brainsuite command line tools. Is it fine to leave the instantiation of outputs how it is now?
@jason-wg
Copy link
Contributor Author

jason-wg commented Jan 8, 2016

I updated the formatting to comply with the PEP8 style guide (The exception is that some lines run over 79 characters)

As for instantiating names, the reason I approached it this way is to shorten the names of outputs that ran through multiple steps of processing using brainsuite command line tools. Is it fine to leave the instantiation of output names how it is now?

else:
outputs['outputMRIVolume'] = self._gen_filename('outputMRIVolume')

if isdefined(self.inputs.outputMaskFile):
Copy link
Member

Choose a reason for hiding this comment

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

these almost seem like a pattern and i would like to simplify their creation. we can work on this after next week.

Added l_outputs function to simplify insantiation of output names/reduce repetition in code
@jason-wg
Copy link
Contributor Author

@satra
Can you please take a look at these updates?
I made a helper function that simplifies the instantiation of output names/reduces repitition in the code.

)


class bseInputSpec(CommandLineInputSpec):
Copy link
Member

Choose a reason for hiding this comment

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

Classes in the rest of Nipype codebase begin with a capitol letter...

@jason-wg
Copy link
Contributor Author

jason-wg commented Mar 5, 2016

Thanks, I removed the use of exec, and further simplified _gen_filename


inputMRIFile = File(exists=True, mandatory=True, argstr='-i %s',
desc='input MRI volume', position=0)
outputMRIVolume = File(mandatory=False,
Copy link
Member

Choose a reason for hiding this comment

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

the mandatory=False can all be removed.

@jason-wg
Copy link
Contributor Author

jason-wg commented Mar 5, 2016

Removed unnecessary metadata

@satra
Copy link
Member

satra commented Mar 5, 2016

the next few steps are:

  • each class needs a description and an example (check the spm/fsl interfaces)
  • make specs
  • make check-before-commit

it would also be useful for future users to add an example for brainsuite, and add it to the examples folder, and test it using run_tests. make sure to modify .circle.yml to add installing brainsuite.

before running make specs, make sure it's merged with master. then use git add + commit to add these autogenerated tests for your interfaces.

before you do the above, you should decide if you want to isolate brainsuite in its own folder. this may be a reasonable thing if you are planning to dissociate components of brainsuite (e.g., see the spm, fsl, freesurfer, ants, interfaces)

jason-wg added 14 commits March 9, 2016 15:34
Added description and doctests
I created an interface for Brainsuite's command line tools. I'd like it to be included in nipype builds installed per the instructions on the nipype website.
When I tried running this code, type(outputs[key]) was never == list or == str, so the method, self.s3tolocal, never got called.
When I tried debugging, type(outputs[key]) turned out to be <type 'unicode'>
I updated the formatting to comply with the PEP8 style guide (The exception is that some lines run over 79 characters)

As for instantiating names, the reason I approached it this way is to shorten the names of outputs that ran through multiple steps of processing using brainsuite command line tools. Is it fine to leave the instantiation of outputs how it is now?
Added l_outputs function to simplify insantiation of output names/reduce repetition in code
Added description and doctests
@jason-wg
Copy link
Contributor Author

jason-wg commented Apr 4, 2016

@satra
I finished adding description and example to each class, and I ran the doctests manually too.

I ran make specs and make check-before-commit.
In 9c12e44 I added the tests that were autogenerated for my classes (I was logged onto my other account, jwongCode)

Running make specs and then make check-before-commit also changed/created some other files that seemed to be unrelated to my interface, and I added them in 515c16e

note: make check-before-commit resulted in some failures in a few doctests contained in files that I hadn't edited, for example: could not locate the file called ./xxx that is referenced in https://github.com/jason-wg/nipype/blob/patch-1/nipype/workflows/dmri/fsl/tbss.py
They were from fsl tests, so could this be from my installation of fsl?

Finally, yes, it's fine to keep Brainsuite in its own folder.

@satra
Copy link
Member

satra commented Apr 4, 2016

@jason-wg - thanks - i see some changes for s3 in io.py. were these things you made? can you perhaps do a diff with an separate download of the master nipype to make sure. every once in a while github does some weird compares.

@jason-wg
Copy link
Contributor Author

jason-wg commented Apr 4, 2016

@satra
No, I didnt actually make any changes in s3 in io.py.
I just noticed those changes too, and a diff with a separate download from master nipype does show differences.
I remember a few months ago I had in fact made changes to io.py to point out an issue while looking at #1316 and #1307
Can we ignore the changes to io.py in my branch?

@satra
Copy link
Member

satra commented Apr 4, 2016

unfortunately github won't allow that through an automated merge. could you simply copy over the io.py and commit it and regenerate the tests or revert the datasink tests that were created.

@jason-wg
Copy link
Contributor Author

jason-wg commented Apr 4, 2016

@satra
I copied over io.py from nipype master, and also reverted datasink tests to match nipype master, and deleted the additional S3DataSink that was generated from my old io.py

@satra
Copy link
Member

satra commented Apr 4, 2016

thanks - a few more things.

  • appears to have one more data sink related file
  • update the CHANGES file

@jason-wg
Copy link
Contributor Author

jason-wg commented Apr 4, 2016

@satra
I udated the CHANGES file, and removed the additional DataSink related files

@satra
Copy link
Member

satra commented Apr 4, 2016

thanks @jason-wg - will wait for all the test to be done.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 73.051% when pulling 98fdb3d on jason-wg:patch-1 into c46b932 on nipy:master.

@jason-wg
Copy link
Contributor Author

jason-wg commented Apr 5, 2016

@satra
Sounds good. Thanks for all your feedback on this PR

@satra satra merged commit 355591b into nipy:master Apr 6, 2016
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.

4 participants