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

ENH: Add support for argstr formatting of any iterable #614

Merged
merged 4 commits into from
Feb 17, 2023

Conversation

ghisvail
Copy link
Collaborator

See #613 for context. I looked at the code path @effigies suggested where the fix should be implemented.

This PR should facilitate composition of interfaces producing and consuming iterable types, not just lists. Sets and tuples provide additional guarantees which are quite nice, such as uniqueness and size boundness respectively. Since strings and bytes also satisfy the Iterable protocol in Python, these need to be discarded explicitly in the instance type check.

Closes #613

@ghisvail
Copy link
Collaborator Author

I took this opportunity to fix a few typos and warnings which PyCharm complained about.

@codecov
Copy link

codecov bot commented Dec 31, 2022

Codecov Report

Base: 81.23% // Head: 81.16% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (549c018) compared to base (a9a116d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #614      +/-   ##
==========================================
- Coverage   81.23%   81.16%   -0.07%     
==========================================
  Files          20       20              
  Lines        4391     4391              
  Branches     1262     1262              
==========================================
- Hits         3567     3564       -3     
- Misses        820      823       +3     
  Partials        4        4              
Flag Coverage Δ
unittests 81.16% <100.00%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
pydra/engine/task.py 93.53% <100.00%> (ø)
pydra/engine/helpers.py 86.05% <0.00%> (-0.71%) ⬇️

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.

Sets don't preserve order of insertion, unlike tuples and lists.
@effigies
Copy link
Contributor

LGTM.

@ghisvail
Copy link
Collaborator Author

Is it ok if I merge this?

@djarecka djarecka merged commit 8967b58 into nipype:master Feb 17, 2023
@djarecka
Copy link
Collaborator

yes, sorry, thank you! I will create a new release during the weekend

@ghisvail ghisvail deleted the fix/argstr-any-iterable branch February 17, 2023 14:50
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.

Proper way to format a tuple parameter
3 participants