Skip to content
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

Provide paths to ShellTask output files #585

Merged
merged 4 commits into from
Oct 19, 2022

Conversation

tclose
Copy link
Contributor

@tclose tclose commented Sep 27, 2022

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Summary

Fixes passing of explicit output paths to shell "output" input fields that define "output_file_template", which otherwise are used in the cmdline string but not when collecting the outputs

Checklist

  • I have added tests to cover my changes (if necessary)

@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Base: 77.13% // Head: 77.01% // Decreases project coverage by -0.12% ⚠️

Coverage data is based on head (eec510f) compared to base (67f7e72).
Patch coverage: 66.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #585      +/-   ##
==========================================
- Coverage   77.13%   77.01%   -0.13%     
==========================================
  Files          20       19       -1     
  Lines        4330     4315      -15     
  Branches     1217     1217              
==========================================
- Hits         3340     3323      -17     
- Misses        802      803       +1     
- Partials      188      189       +1     
Flag Coverage Δ
unittests 76.91% <66.66%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pydra/engine/specs.py 88.00% <66.66%> (-0.59%) ⬇️
pydra/__init__.py

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yibeichan
Copy link
Collaborator

(continue your example from brainhack) so output_file_template will automatically generate a new file which has the same filename as your input file. In your case, you will get text_zipped.txt if your input file is test.txt.
Maybe you want to give output_callable a try? Here is an example https://github.com/nipype/pydra-fsl/blob/6957eb67ea8785f8aae1d2aa858a9a1a85a4b51a/pydra/tasks/fsl/model/filmgls.py#L6
the function defined here is a callable and will be used here https://github.com/nipype/pydra-fsl/blob/6957eb67ea8785f8aae1d2aa858a9a1a85a4b51a/pydra/tasks/fsl/model/filmgls.py#L276
I might be wrong. Dorota knows better. She is out of town this week and will come back next week.

@tclose
Copy link
Contributor Author

tclose commented Sep 27, 2022

(continue your example from brainhack) so output_file_template will automatically generate a new file which has the same filename as your input file. In your case, you will get text_zipped.txt if your input file is test.txt.

Yes, this is the case when the out_file path isn't explicitly provided. But if you explicitly provide a path to out_file (required for mrconvert, which uses the output extension to determine the desired format) then the collected path and the one used in the cmdline will differ and
attrs.NOTHING will be returned when pydra finds out that the path doesn't exist.

Maybe you want to give output_callable a try? Here is an example https://github.com/nipype/pydra-fsl/blob/6957eb67ea8785f8aae1d2aa858a9a1a85a4b51a/pydra/tasks/fsl/model/filmgls.py#L6

the function defined here is a callable and will be used here https://github.com/nipype/pydra-fsl/blob/6957eb67ea8785f8aae1d2aa858a9a1a85a4b51a/pydra/tasks/fsl/model/filmgls.py#L276

Thanks, you could get it to work using a callable, but it seems to me that this shouldn't be necessary.

I might be wrong. Dorota knows better. She is out of town this week and will come back next week.

No worries, thanks for the input.

@djarecka
Copy link
Collaborator

thanks! It is definitely needed option in case someone wants to provide the name directly!

@djarecka djarecka merged commit 42f7894 into nipype:master Oct 19, 2022
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.

3 participants