Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

changes.py: VisibleDeprecationWarning: boolean index did not match indexed array along dimension 0 #83

Closed
valpasq opened this issue Mar 25, 2016 · 1 comment
Milestone

Comments

@valpasq
Copy link
Collaborator

valpasq commented Mar 25, 2016

Was trying to create change map products using yatsm changemap, encountered a VisibleDepreciationWarning.

Quick search revealed this could be due to updating numpy:
http://stackoverflow.com/questions/33098765/visibledeprecationwarning-boolean-index-did-not-match-indexed-array-along-dimen

Updated changes.py, line 169 from
py = rec['py'][np.in1d(px, rec['px'])]

to
py = rec['py'][np.where(np.in1d(px, rec['px']))]

Seems to have fixed the problem. Code is running, and maps look good.

Pulled the most updated version of yatsm, then fixed in my fork with commit dff0052

If this is a good fix, I can submit a pull request.

@ceholden ceholden added this to the v0.6.0 milestone Apr 22, 2016
ceholden added a commit that referenced this issue Apr 22, 2016
Also improves speed of calculating number of change
maps. Algorithm for mapping this information takes
better advantage of new NumPy features (1.9+) and it
relaxes the assumption that the record under analysis
only holds 1 line/row worth of information.
@ceholden
Copy link
Owner

Should be fixed in v0.6.0 release. Your solution was a good bandaid, but the problem was much more serious than could be addressed without some major surgery. The new algorithm for calculating the number of changes per pixel should be more straightforward to understand, faster, and more reliable, but it requires us to bump to NumPy>=1.9.0 to get the new np.unique features utilized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants