ContextLab / ContextLab/supereeg

Hard coded int vs variable int produce different slicing results in brain object

Open
#203 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
38
Forks
19
PR merge metrics
No merged PRs in 30d

Description

![Screen Shot 2020-04-29 at 6 34 43 PM](https://user-images.githubusercontent.com/8229664/80663182-23bba580-8a48-11ea-82a4-b27c3721c7b9.png)

Slicing a brain object with an int variable produces an empty brain object (no elecs, no data).
Slicing a brain object with an int variable wrapped in a list returns the correct brain object.
Slicing a brain object with an int returns the correct brain object.

__get_item__ method calls get_slice
https://github.com/ContextLab/supereeg/blob/master/supereeg/brain.py#L325

which seems to wrap the int in a list

![Screen Shot 2020-04-29 at 6 44 09 PM](https://user-images.githubusercontent.com/8229664/80663650-7053b080-8a49-11ea-8200-2bd1b93edab1.png)

the left pane shows a debugging breakpoint ("import ipdb; ipdb.set_trace()") but on the right pane you can see when the slicing is run, it doesn't trigger the breakpoint so it must be bypassing the method

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in supereeg/brain.py at Brain.__getitem__ around line 325 and follow its call to get_slice; compare slicing with a literal int, an int variable, and a one-item list. Done means the variable-int form returns the same populated brain object as the equivalent forms, preserving electrodes and data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.