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

Inspecting Numpy bool arrays in Var. Explorer uses deprecated '-' operator in Numpy #4663

Closed
GKosiba opened this issue Jun 27, 2017 · 1 comment

Comments

@GKosiba
Copy link
Contributor

GKosiba commented Jun 27, 2017

Description of your problem

(..)/site-packages/spyderlib/widgets/arrayeditor.py", line 249, in data
/(self.vmax-self.vmin)
TypeError: numpy boolean subtract, the operator '-', is deprecated, use the bitwise_xor, the '^' operator, or the logical_xor function instead.
What steps will reproduce the problem?

  1. import numpy as np
  2. test = np.zeros((3,3),dtype='bool')
  3. Double click test in variable explorer window

What is the expected output? What do you see instead?
Popup window of the array w/ values. Crash (Seg. Fault)

Please provide any additional information below

Versions and main components

  • Spyder Version: 3.1.4
  • Python Version: 2.7.5
  • Qt Version: 4.8.5
  • PyQt Version: 4.11.4
  • Operating system: RHEL7

Dependencies

jedi >=0.9.0 : 0.10.2 (OK)
matplotlib >=1.0 : 2.0.2 (OK)
nbconvert >=4.0 : 5.2.1 (OK)
numpy >=1.7 : 1.14.0.dev0+03283c2 (OK)
pandas >=0.13.1 : 0.18.1 (OK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 5.2.2 (OK)
pyflakes >=0.5.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.2 (OK)
qtconsole >=4.2.0: 4.3.0 (OK)
rope >=0.9.4 : 0.10.5 (OK)
sphinx >=0.6.6 : 1.6.2 (OK)
sympy >=0.7.3 : None (NOK)

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

@ccordoba12 ccordoba12 added this to the v3.2.1 milestone Jun 27, 2017
@ccordoba12 ccordoba12 changed the title Inspecting bool arrays in Var. Explorer(arrayeditor.py) uses deprecated '-' operator in numpy Inspecting Numpy bool arrays in Var. Explorer uses deprecated '-' operator in Numpy Jun 27, 2017
@ccordoba12
Copy link
Member

ccordoba12 commented Jun 27, 2017

Thanks for reporting. The fix seems simple enough, would you like to submit a pull request for it? If you do, please make your PR against our 3.x branch.

GKosiba added a commit to GKosiba/spyder that referenced this issue Jun 27, 2017
Changed numpy boolean subract operator '-' to np.logical_xor. As suggested in the numpy deprec warning.
Tested locally with no error originally described in spyder-ide#4663
@ccordoba12 ccordoba12 modified the milestones: v3.2, v3.2.1 Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants