nipype / pydra

Pydra Dataflow Engine
https://nipype.github.io/pydra/
Other
120 stars 59 forks source link

`cmd_arg` and `cmd_out` syntactic sugar funcs for attrs.field in `ShellSpec`/`ShellOutSpec` #653

Closed tclose closed 1 year ago

tclose commented 1 year ago

Types of changes

Summary

Adds the pydra.mark.shell_commands.cmd_arg() and pydra.mark.shell_commands.cmd_out() methods to streamline the definition of input/output specs for shell command task definitions. Instead of creating an attrs.field by hand and setting the metadata directly, cmd_arg and cmd_out do this for you.

The main benefit is that cmd_arg and cmd_out specify the valid metadata fields that can be added to the input and output fields, making the code more self-documenting. It also makes the task definitions slightly less verbose.

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 :warning:

Comparison is base (426564e) 81.77% compared to head (39b39ce) 81.76%.

:exclamation: Current head 39b39ce differs from pull request most recent head f855fa1. Consider uploading reports for the commit f855fa1 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #653 +/- ## ========================================== - Coverage 81.77% 81.76% -0.01% ========================================== Files 20 21 +1 Lines 4400 4410 +10 Branches 1264 0 -1264 ========================================== + Hits 3598 3606 +8 - Misses 798 804 +6 + Partials 4 0 -4 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `81.76% <100.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipype#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/nipype/pydra/pull/653?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipype) | Coverage Δ | | |---|---|---| | [pydra/mark/\_\_init\_\_.py](https://app.codecov.io/gh/nipype/pydra/pull/653?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipype#diff-cHlkcmEvbWFyay9fX2luaXRfXy5weQ==) | `100.00% <100.00%> (ø)` | | | [pydra/mark/shell\_commands.py](https://app.codecov.io/gh/nipype/pydra/pull/653?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipype#diff-cHlkcmEvbWFyay9zaGVsbF9jb21tYW5kcy5weQ==) | `100.00% <100.00%> (ø)` | | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/nipype/pydra/pull/653/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipype)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

tclose commented 1 year ago

If you look at the codecov report, the coverage doesn't actually change, so not sure where the -5.07% drop is coming from

tclose commented 1 year ago

See discussion in https://github.com/nipype/pydra/discussions/647 for background on this PR

djarecka commented 1 year ago

do I understand correctly that #655 replaces this one?

tclose commented 1 year ago

Closing until #692 is settled