Skip to content

setitem indexing with Lists #918

@mtar

Description

@mtar

Description
setitem raises an TypeError when a list is used for indexing along the split axis .

To Reproduce
Steps to reproduce the behavior:

  1. Which module/class/function is affected?
    setitem
  2. What are the circumstances under which the bug appears?
    indexing along the split axis
  3. What is the exact error message / erroneous behavior?
[1,1]<stderr>:  File "lib/python3.8/site-packages/heat/core/dndarray.py", line 1639, in __setitem__
[1,1]<stderr>:    key[self.split] -= chunk_start
[1,1]<stderr>:TypeError: unsupported operand type(s) for -=: 'list' and 'int'

Expected behavior
accept lists

Illustrative

import heat as ht

a = ht.arange(3, split=0)
a[[0,1]] = a[[1,0]]
print(a)

Version Info
master

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingindexing

Type

No type
No fields configured for issues without a type.

Projects

Status
In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions