-
Notifications
You must be signed in to change notification settings - Fork 532
ENH: Add "ExportFile" interface as simple alternative to "DataSink" #3054
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
Hi @stilley2, could you clarify the reasoning here? Is the idea to use this as a kind of cheap |
Hi @effigies , yeah that's exactly what I was thinking. Specifically it could be used when output file name generation is handled by an external program (e.g. pybids). Perhaps a new interface would be clearer than hijacking Rename for this purpose? |
I think so. It may be that Given that you're looking at using pybids, you could also check out |
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.
Thanks for this. I've made some suggestions. Another thing you can look into to avoid using _list_outputs
in addition to _run_interface
is SimpleInterface
.
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #3054 +/- ##
==========================================
- Coverage 68.19% 64.58% -3.62%
==========================================
Files 297 295 -2
Lines 39771 39712 -59
Branches 5210 5202 -8
==========================================
- Hits 27123 25648 -1475
- Misses 11939 13025 +1086
- Partials 709 1039 +330
Continue to review full report at Codecov.
|
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Ah, you have a nipype/nipype/utils/filemanip.py Lines 43 to 52 in 1ccd70b
There's also a Python 3.5 issue, which I suspect will be fixed if you merge/rebase master. I would certainly try that before we start digging deeper. |
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 think this will resolve the Python 3.5 issue. I don't think we need to obsess over what happens if people pass pathlib2.Path
s as File
traits on Python 3.5.
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
…o feature/Rename_copy_trait
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.
Thanks for this. Some suggestions. I think the test failure is related to output_folder
...
nipype/interfaces/io.py
Outdated
>>> from nipype.interfaces.io import ExportFile | ||
>>> import os.path as op | ||
>>> ef = Node(ExportFile(), "export") | ||
>>> ef.inputs.in_file = "temporary_file.nii.gz" |
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 file needs to exist. By default, all doctests are run in nipype/testing/data, so there are a lot of options to pick from.
nipype/interfaces/io.py
Outdated
|
||
A trivial example that copies temporary_file.nii.gz | ||
to sub1_out.nii.gz. (A more realistic example would set | ||
in_file as the output of another Node.) |
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 feels like an unnecessary qualifier. I think you could probably just skip this text, unless you want to have multiple tests showing off check_extension
and clobber
. If so, you could say "By default, file extensions need to match, and the output file should not exist:" and something similar above the other examples.
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Thanks @effigies . Sorry for the delay. Busy week. |
No worries. This looks good. Two minor issues should fix up the tests, I think. |
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Can you run |
Acknowledgment