Consider adding warning for advanced indexing with logical indexer

Open
#178 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

Start by locating AdvancedIndexingNode and reviewing how logical ArrayNode indexers are handled. Confirm the current behavior against the linked NumPy boolean-indexing documentation, then ensure a logical indexer produces a warning explaining that it is treated as an integer index.

Written by the indexing model from the issue text.

Description

enhancement

Currently, we don't support boolean 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.

Dominant language
C++
Stars
31
Forks
36
Avg merge
1d 9h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dwavesystems/dwave-optimization

All issues in dwavesystems/dwave-optimization

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.