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

MNT: Drop traits upper bound #3685

Merged
merged 9 commits into from
Oct 4, 2024
Merged

MNT: Drop traits upper bound #3685

merged 9 commits into from
Oct 4, 2024

Conversation

effigies
Copy link
Member

@effigies effigies commented Oct 3, 2024

This PR:

  • Pins numpy<2. Until dipy releases a version compatible with numpy 2, it's not worth it. Numpy 1.26 is the default in present in major distros for now.
  • Subclasses traits.BaseTuple to recover the previously lax behavior that allowed Tuple() 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.
  • Small compatibility fix for dipy and traits.
  • Drops Python 3.8 support, which is scheduled to be EOL next week.
  • Adapts to change in networkx graphviz outputs, which removed a space. It doesn't seem worth making the logic even more complex to test a cosmetic difference on a wide range of networkx versions.

Closes #3661.

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 99.52381% with 1 line in your changes missing coverage. Please review.

Project coverage is 70.83%. Comparing base (4d1352a) to head (f2e9d32).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
nipype/interfaces/spm/base.py 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Member Author

@effigies effigies left a 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")
Copy link
Member Author

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?

Comment on lines +165 to +175
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,
Copy link
Member Author

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.

Copy link
Member

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

🚀 nice!

@effigies effigies merged commit e03ab6f into nipy:master Oct 4, 2024
19 checks passed
@effigies effigies deleted the mnt/traits branch October 4, 2024 19:05
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.

Please consider making nipype compatible with traits >= 6.4
2 participants