Skip to content

Conversation

@djarecka
Copy link
Collaborator

@djarecka djarecka commented Jul 15, 2020

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Summary

  • refactoring the template formatting, separating

    • the argstr case (e.g. argstr=[{out1}, {out2}])
    • the output field that has output_template_file in spec (e.g. {inpA}_out)
  • fixing issue with the extensions in templates:

    • if template itself has extension, than the extension from the input value is removed (if any), e.g. if inpA="file.text", than outA with a template {inpA}_out.txt should create file_out.txt
    • if only the input value has an extension, than the extension is moved to the end, e.g. if inpA="file.txt", than outA with a template {inpA}_out should create file_out.txt

Checklist

  • All tests passing
  • I have added tests to cover my changes
  • I have updated documentation (if necessary)
  • My code follows the code style of this project
    (we are using black: you can pip install pre-commit,
    run pre-commit install in the pydra directory
    and black will be run automatically with each commit)

Acknowledgment

  • I acknowledge that this contribution will be available under the Apache 2 license.

… the output_template_file in spec; fixing issue with the extension (so the sufix is added properly)
@satra
Copy link
Contributor

satra commented Jul 15, 2020

nipype has this metadata field keep_extension which could be used to indicate whether the input extension should be kept or not. i can imagine a situation where the output name should be based on the input but may not have any extension. we can co-opt the metadata to allow extensionless output by setting keep_extension=False. the default behavior (keep_extension=True or missing) would be to keep the input extension unless the field_template provides an extension

@codecov
Copy link

codecov bot commented Jul 16, 2020

Codecov Report

Merging #315 into master will decrease coverage by 0.12%.
The diff coverage is 86.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #315      +/-   ##
==========================================
- Coverage   86.17%   86.05%   -0.13%     
==========================================
  Files          20       20              
  Lines        3349     3384      +35     
  Branches      891      898       +7     
==========================================
+ Hits         2886     2912      +26     
- Misses        295      298       +3     
- Partials      168      174       +6     
Flag Coverage Δ
#unittests 86.05% <86.11%> (-0.13%) ⬇️

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

Impacted Files Coverage Δ
pydra/engine/helpers_file.py 78.68% <77.27%> (-1.32%) ⬇️
pydra/engine/core.py 89.79% <100.00%> (ø)
pydra/engine/helpers.py 87.17% <100.00%> (+0.66%) ⬆️
pydra/engine/specs.py 90.49% <100.00%> (-0.07%) ⬇️
pydra/engine/task.py 82.80% <100.00%> (-0.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5005173...d94b3b3. Read the comment docs.

@djarecka djarecka modified the milestone: 0.8 - agosto Jul 16, 2020
@djarecka djarecka changed the title [mnt, bug] refactoring the template formatting [mnt, bug] refactoring the template formatting (closes #314) Jul 17, 2020
@djarecka
Copy link
Collaborator Author

@satra - unless you have any other comments, I'll merge it

@satra
Copy link
Contributor

satra commented Jul 30, 2020

@djarecka - looks good to me.

need to have documentation around this.

@djarecka djarecka merged commit 6c9d083 into nipype:master Jul 30, 2020
@djarecka djarecka deleted the fix/ext_template branch December 30, 2022 20:37
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.

2 participants