dwavesystems / dwavesystems/dwave-optimization

Consider adding warning for advanced indexing with logical indexer

Open
#178 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
31
Forks
36
Avg merge
16h 55m
Merged PRs (30d)
8

Description

Currently, we don't support [boolean indexing](https://numpy.org/doc/stable/user/basics.indexing.html#boolean-array-indexing) in our implementation of advanced indexing (`AdvancedIndexingNode`).

If an `ArrayNode` which is logical is used to index another node, `AdvancedIndexingNode` will simply treat it as any other integer indexer, and return a selection of the first and second elements of the main array. Though this is technically correct, it is somewhat of a departure from the numpy behavior.

To help clarify this to users, we could raise a warning if the indexer is logical to say that it will be treated as an integer index.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.