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

Replace deprecated numpy types #798

Merged
merged 12 commits into from
Apr 20, 2021
Merged

Conversation

guyer
Copy link
Member

@guyer guyer commented Apr 17, 2021

Recent NumPy versions (~1.20) raise a number of deprecation warnings:

  • "np.bool is a deprecated alias for the builtin bool" in fipy.variables.variable
  • "np.int is a deprecated alias for the builtin int" in skfmm
  • "Converting np.character to a dtype is deprecated" in tvtk
  • "'TraitPrefixMap' trait handler has been deprecated" in tvtk

@guyer
Copy link
Member Author

guyer commented Apr 17, 2021

Remaining failures are unrelated to this PR:

@guyer guyer requested review from tkphd and wd15 April 17, 2021 23:22
@guyer guyer mentioned this pull request Apr 18, 2021
Copy link
Contributor

@tkphd tkphd left a comment

Choose a reason for hiding this comment

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

Seems reasonable. I have not tested locally, but confirmed that the CI errors are unrelated. LGTM.

As of NumPy 1.20, skfmm warns "`np.int` is a deprecated alias for the builtin `int`".
This has been [fixed](scikit-fmm/scikit-fmm@4c98944)
but hasn't percolted to PyPI, yet.
tvtk warns "Converting `np.character` to a dtype is deprecated."
We'll hopefully be getting rid of dependency on tvtk altogether
@guyer guyer changed the title Replace deprecated np.bool with bool Replace deprecated numpy types Apr 19, 2021
tvtk warns "'TraitPrefixMap' trait handler has been deprecated".
We'll hopefully be getting rid of dependency on tvtk altogether
@guyer guyer requested a review from tkphd April 19, 2021 15:31
@guyer
Copy link
Member Author

guyer commented Apr 19, 2021

I've added more changes of the same character, although in these cases, the deprecations are not in our code, so I've silenced the errors in the tests, rather than doing anything useful to make the deprecation go away.

  • skfmm has already been fixed and just needs to percolate to pip.
  • tvtk has been fixed, but we're getting mayavi 4.7.1 instead of 4.7.2 for some reason. Regardless, my hope is to excise it completely in the rather short term.

@guyer
Copy link
Member Author

guyer commented Apr 19, 2021

A better picture of the test status can be seen in the integration tests at #799

Hopefully will pull in newer mayavi, which should silence deprecations
Python 3.9 not supported yet
defaults is needed for mayavi
Copy link
Contributor

@tkphd tkphd left a comment

Choose a reason for hiding this comment

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

All checks pass in #799. Yeet those types.

@guyer guyer merged commit 1b06871 into usnistgov:master Apr 20, 2021
@guyer guyer deleted the np_bool_is_deprecated branch April 20, 2021 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants