Skip to content

Adds child cascading to assign_context_to_process_group #267

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 3 commits into from
May 13, 2022

Conversation

sdairs
Copy link
Contributor

@sdairs sdairs commented Mar 25, 2021

Adds an optional bool to assign_context_to_process_group that, when True, will cascade the assigned Parameter Context down to the direct children Process Groups of the named Process Group. Does not recur down to nested-children.

Adds an optional bool to assign_context_to_process_group that, when True, will cascade the assigned Parameter Context down to the direct children Process Groups of the named Process Group. Does not recur down to nested-children.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 68.709% when pulling 4b3da74 on sdairs:cascae-context into 292aa1e on Chaffelson:main.

@coveralls
Copy link

coveralls commented Mar 25, 2021

Coverage Status

Coverage increased (+0.2%) to 68.995% when pulling 3941b04 on sdairs:cascae-context into 292aa1e on Chaffelson:main.

Copy link
Collaborator

@ottobackwards ottobackwards left a comment

Choose a reason for hiding this comment

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

I think this is a good capability, but API wise it seems a little odd.

  1. It only recurses one level, shouldn't it call itself on the child so the child recurses all the way down instead of update_process_group? That would also be cleaner.
  2. It returns the top level process group, so all the children modified are 'lost', this seems counter to the api. It returns the process group for a reason right?

Maybe a new api on top would be a better fit than putting it inside this api.
@Chaffelson ?

@ottobackwards
Copy link
Collaborator

Ok, so I was mistaking on 1. wrt actually getting to all the children, sorry. I still think changing the call might be right ( looking for @Chaffelson input though )
Sorry.

Thanks for the contribution as well!

@sdairs
Copy link
Contributor Author

sdairs commented Mar 25, 2021

Originally I went with single depth as I hadn't thought through all of the consequences of recurring over all children yet - After discussion with @Chaffelson I changed this to recur down to all children, so it's doing that after the second commit.

wrt to point 2 - yep, welcome feedback on that - I had considered returning a list of all the child PGs affected, but that meant either 1. changing the return type so it always returns a list or 2. having more than one possible return type - neither sounded ideal. Open to suggestions

@sdairs sdairs changed the title Adds direct-child cascading to assign_context_to_process_group Adds child cascading to assign_context_to_process_group Mar 25, 2021
@Chaffelson Chaffelson merged commit a6e4f79 into Chaffelson:main May 13, 2022
rsaggino pushed a commit to rsaggino/nipyapi that referenced this pull request Nov 2, 2022
* Adds direct-child cascading to assign_context_to_process_group

Adds an optional bool to assign_context_to_process_group that, when True, will cascade the assigned Parameter Context down to the direct children Process Groups of the named Process Group. Does not recur down to nested-children.

* Updates cascade to recur to all children rather than immediate only

* removed pprint import

oops

Co-authored-by: abrown <[email protected]>
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.

4 participants