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

DeprecationWarnings in axis.py after updating NumPy #266

Closed
halsafar opened this issue Jan 16, 2015 · 6 comments
Closed

DeprecationWarnings in axis.py after updating NumPy #266

halsafar opened this issue Jan 16, 2015 · 6 comments

Comments

@halsafar
Copy link

We updated NumPy in our project virtual environment and now we get a ton of terminal spam in the form of:

python2.7/site-packages/chaco-4.5.0-py2.7-linux-x86_64.egg/chaco/axis.py:498:
 DeprecationWarning: elementwise comparison failed; this will raise the
 error in the future.
   for tickpos in mapped_tick_positions]))
python2.7/site-packages/chaco-4.5.0-py2.7-linux-x86_64.egg/chaco/axis.py:499:
 DeprecationWarning: elementwise comparison failed; this will raise the
 error in the future.
   self._tick_label_list = tick_list

We updated chaco to the newest stable and we still get the deprecation warnings.

@jonathanrocher
Copy link
Collaborator

Thanks for reporting the issue. What version of NumPy did you update to? Until we look into this, if you need to turn off warnings, it is possible to filter them out of your terminal output using https://docs.python.org/2/library/warnings.html .

@corranwebster
Copy link
Contributor

This is almost certainly related to #251.

@corranwebster
Copy link
Contributor

To add a little color, this is a change introduced in NumPy 1.9.0 that changes the way that NumPy compares arrays to objects to more consistently use elementwise comparison. See http://docs.scipy.org/doc/numpy/release.html#object-array-equality-comparisons

In particular arr == None will behave differently in the future, and this comparison is particularly prevalent in Traits-based code that interacts with NumPy.

At the present time these are just warnings and NumPy's behaviour is unchanged, so Chaco should still be working correctly. As @jonathanrocher mentioned above, it is possible to filter these warnings out using the standard library's warning module (or even print a particular warning just once. In fact, it is a little surprising that you are seeing DeprecationWarnings at all, since they are filtered out by default in Python 2.7.

We've already made the appropriate changes in Traits that will allow us to resolve this issue, and I would expect that we will be resolving it in Chaco and other libraries in the near term.

@halsafar
Copy link
Author

halsafar commented Feb 4, 2015

Thanks for the movement on this.

We updated straight to NumPy 1.9.1 when we noticed this issue. Although based on previous comments it appears that it was NumPy 1.9.0 that started the issue.

@halsafar
Copy link
Author

halsafar commented Mar 4, 2015

Any movement on this?

@rkern
Copy link
Member

rkern commented Dec 18, 2017

Fixed by #350

@rkern rkern closed this as completed Dec 18, 2017
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

No branches or pull requests

4 participants