Skip to content

adding verbose as an optional argument to Task.result #241

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

Merged
merged 2 commits into from
May 3, 2020

Conversation

djarecka
Copy link
Collaborator

@djarecka djarecka commented Apr 30, 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

the additional argument allows to return results values together with input fields that correspond to a specific value.
If True or val - values of input fields is provided, if ind - indices of input fields are provided

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.

…lts values together with valuesor indices of input fields; fixing test_task_state_comb_2 (was not run previously, name conflict)
@djarecka djarecka requested review from satra and nicolocin April 30, 2020 04:01
@djarecka
Copy link
Collaborator Author

@nicolocin @satra - I've added an option to print the values or indices of the inputs together with the results. This is only a simple form that just uses state properties.

It also works for workflow if splitter/combiner is set on a workflow level. If it's on the node level, than wf doesn't have any state. This would have to be changed when results is being saved in files, we can think about it at some point, but not in this pr.

@codecov
Copy link

codecov bot commented Apr 30, 2020

Codecov Report

Merging #241 into master will decrease coverage by 2.71%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
- Coverage   86.72%   84.00%   -2.72%     
==========================================
  Files          17       17              
  Lines        2870     2889      +19     
  Branches      768      778      +10     
==========================================
- Hits         2489     2427      -62     
- Misses        238      325      +87     
+ Partials      143      137       -6     
Flag Coverage Δ
#unittests 84.00% <78.57%> (-2.72%) ⬇️
Impacted Files Coverage Δ
pydra/engine/core.py 89.00% <78.57%> (-0.43%) ⬇️
pydra/engine/workers.py 38.00% <0.00%> (-47.34%) ⬇️
pydra/__init__.py 86.66% <0.00%> (-6.67%) ⬇️
pydra/engine/submitter.py 87.50% <0.00%> (-3.85%) ⬇️
pydra/engine/helpers.py 88.63% <0.00%> (-0.46%) ⬇️

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 5c5991d...52dd86e. Read the comment docs.

Copy link
Collaborator

@nicolocin nicolocin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djarecka - This is great thanks a lot! Though would something more descriptive like return_inputs be better? verbose just sounds kind of vague.

Maybe add an example in one of the more complicated workflows in the intro_workflow tutorial so documentation is updated?

@djarecka
Copy link
Collaborator Author

djarecka commented May 1, 2020

@nicolocin - ok, can change the name

regarding notebooks - you are right, the notebooks should be updated, but this is not the only thing that should be updated, I would do it in a separate PR, will work on this this week

@djarecka djarecka merged commit e025ee0 into nipype:master May 3, 2020
@djarecka djarecka deleted the enh/result_verb branch December 30, 2022 20:47
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