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

MAINT: Avoid NumPy deprecations #2695

Closed
wants to merge 1 commit into from
Closed

Conversation

larsoner
Copy link
Contributor

Avoid at least some warnings of the form:

  /home/larsoner/python/nilearn/nilearn/glm/regression.py:100: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

@codecov
Copy link

codecov bot commented Feb 12, 2021

Codecov Report

Merging #2695 (a0aafd7) into master (29f64ef) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2695      +/-   ##
==========================================
+ Coverage   87.58%   87.61%   +0.02%     
==========================================
  Files         100      100              
  Lines       13164    13164              
  Branches     2555     2555              
==========================================
+ Hits        11530    11533       +3     
+ Misses       1026     1024       -2     
+ Partials      608      607       -1     
Impacted Files Coverage Δ
nilearn/glm/first_level/first_level.py 74.38% <100.00%> (ø)
nilearn/glm/first_level/hemodynamic_models.py 95.28% <100.00%> (ø)
nilearn/glm/regression.py 75.69% <100.00%> (ø)
nilearn/reporting/_get_clusters_table.py 100.00% <0.00%> (+3.19%) ⬆️

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 29f64ef...ba4cab2. Read the comment docs.

Copy link
Member

@NicolasGensollen NicolasGensollen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

Thx, this is great ! But I see many more of those in the codebase...

@larsoner
Copy link
Contributor Author

The only ambiguity I see is whether to convert np.int to int (32-bit on Windows) or np.int64. If you're okay with me doing np.int64 everywhere I can probably make the rest of the substitutions

@bthirion
Copy link
Member

I looked a bit superficially, and my first impression is that int would do the job in most places.

@larsoner
Copy link
Contributor Author

Looks like these got implemented elsewhere by now

@larsoner larsoner closed this Feb 17, 2022
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.

3 participants