-
Notifications
You must be signed in to change notification settings - Fork 530
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
MNT: Drop traits upper bound #3685
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3685 +/- ##
=======================================
Coverage 70.83% 70.83%
=======================================
Files 1276 1276
Lines 59314 59320 +6
Branches 9824 9826 +2
=======================================
+ Hits 42013 42019 +6
Misses 16125 16125
Partials 1176 1176 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgxd Could I bother you for a review? It hits a lot of files, but the changes aren't complicated.
@@ -3821,8 +3822,8 @@ class QwarpInputSpec(AFNICommandInputSpec): | |||
maxlen=5, | |||
xor=["wmask"], | |||
) | |||
traits.Tuple((traits.Float(), traits.Float()), argstr="-bpass %f %f") | |||
wmask = traits.Tuple( | |||
bandpass = Tuple((traits.Float(), traits.Float()), argstr="-bpass %f %f") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shotgunosine I assume this was the original intent?
if len(p) > 3 and p[3] is not None: | ||
default_value = p[3] | ||
if isinstance(traits_type, traits.List) and not isinstance( | ||
default_value, list | ||
): | ||
default_value = [default_value] | ||
attr[name] = traits_type( | ||
p[3], desc=desc[-1], usedefault=True, mandatory=is_mandatory | ||
default_value, | ||
desc=desc[-1], | ||
usedefault=True, | ||
mandatory=is_mandatory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skoudoro Could you check my work here? There were a couple failures without this, where a list with default values of None
or 2
would fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 nice!
This PR:
traits.BaseTuple
to recover the previously lax behavior that allowedTuple()
to check the length and types of arguments without insisting on the container. This fixes the problem that traits. 6.4 introduced, which particularly broke JSON load/save of input specs.Closes #3661.