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

"Lasso" tool is broken with NumPy 1.10 #296

Closed
andrewcollette opened this issue May 10, 2016 · 2 comments
Closed

"Lasso" tool is broken with NumPy 1.10 #296

andrewcollette opened this issue May 10, 2016 · 2 comments

Comments

@andrewcollette
Copy link
Contributor

The regression.py and scatter.py demos work with NumPy 1.8, but on NumPy 1.10 they produce the following output:

Traceback (most recent call last):
  File "build/bdist.macosx-10.6-x86_64/egg/enable/qt4/base_window.py", line 225, in mouseReleaseEvent
  File "build/bdist.macosx-10.6-x86_64/egg/enable/qt4/base_window.py", line 114, in mouseReleaseEvent
  File "build/bdist.macosx-10.6-x86_64/egg/enable/abstract_window.py", line 348, in _handle_mouse_event
  File "build/bdist.macosx-10.6-x86_64/egg/enable/component.py", line 918, in dispatch
  File "build/bdist.macosx-10.6-x86_64/egg/enable/component.py", line 958, in _new_dispatch
  File "build/bdist.macosx-10.6-x86_64/egg/enable/container.py", line 514, in _dispatch_stateful_event
  File "build/bdist.macosx-10.6-x86_64/egg/enable/component.py", line 918, in dispatch
  File "build/bdist.macosx-10.6-x86_64/egg/enable/component.py", line 946, in _new_dispatch
  File "build/bdist.macosx-10.6-x86_64/egg/enable/interactor.py", line 94, in dispatch
  File "build/bdist.macosx-10.6-x86_64/egg/enable/interactor.py", line 110, in _dispatch_stateful_event
  File "build/bdist.macosx-10.6-x86_64/egg/chaco/tools/lasso_selection.py", line 159, in selecting_left_up
  File "build/bdist.macosx-10.6-x86_64/egg/chaco/tools/lasso_selection.py", line 172, in selecting_mouse_up
  File "build/bdist.macosx-10.6-x86_64/egg/chaco/tools/lasso_selection.py", line 274, in _update_selection
TypeError: ufunc 'bitwise_or' output (typecode 'i') could not be coerced to provided output parameter (typecode '?') according to the casting rule ''same_kind''

This is with Chaco "4.6.0.dev123-1" and NumPy "1.10.4-1". Demos in question are here:

http://docs.enthought.com/chaco/user_manual/annotated_examples.html#regression-py

@andrewcollette
Copy link
Contributor Author

On NumPy 1.7.1, this is also observed:

/Users/acollette/Documents/development/irig/.devenv/lib/python2.7/site-packages/chaco/tools/lasso_selection.py:274: DeprecationWarning: Implicitly casting between incompatible kinds. In a future numpy release, this will raise an error. Use casting="unsafe" if this is intentional.

@corranwebster
Copy link
Contributor

Underlying issue is with enable/kiva/agg wrapping code where points_in_polygon returns an array of int. Two-phase fix should be:

  • a band-aid in Chaco where we do astype(bool).
  • a proper fix in kiva where we return an array of dtype bool form points_in_polygon

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

2 participants