-
Notifications
You must be signed in to change notification settings - Fork 536
MRG: Refactor: changing filename generation to a more consistent model #681
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
so if I get it right, this would change from being able to specify the prefix/suffix in the interface specification and instantiation to only the former? |
the sequence of operations are: in parse_args:
in filename_from_source
and then later on in list outputs:
so from an interface developer perspective i think in most cases you could get by with simply the inputspec and outputspec declarations and in some cases you might want to implement _overload_extension. for example, if an interface really wants abspath then
or in the case of FSL, it can change the extension to the expected default. |
@chrisfilo added docs - also modified another interface (FLIRT) to match with doc example. |
* master: fix: ridiculous mistakes fix: make sure mandatory=False items are displayed
The only concern I have is for backward compatibility with pipeline that I am running regularly:
but now if I merge this pr, all the nodes and descendants will have to rerun because nipype expects %s_calc.ext file for instance.
I know this feature was not yet really stable but I do wonder if we could keep also detecting %s in the value for filename to be generated. |
core-devs please review. (unfortunately a bunch of PEP-8 fixes are also there).
This patch is to demonstrate a plan to refactor filename generation and thereby simplify interface creation.
@bpinsard, @inati - comments much appreciated
in this commit take a look at the InvWarp class in utils.py.
to use this, the interface developer should:
name_source: indicates which field to draw a name from, this field must be the name of a File
name_template (optional): if you want to override the default _generated suffix
keep_extension (optional): if you want the extension from the input to be kept.