Task.read has inconsistent return type between normal AI and power channels
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 592
- Forks
- 199
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 10
Description
For normal AI channels, leaving samples_to_read unset reduces the dimensions of the resulting list:
- Single channel task:
- task.read() -> scalar
- task.read(1) -> 1D list by sample
- task.read(N) -> 1D list by sample
- Multi-channel task:
- task.read() -> 1D list by channel
- task.read(1) -> 2D list by channel, sample
- task.read(N) -> 2D list by channel, sample
However, for power channels, explicitly setting samples_to_read=1 has the same effect:
- Single channel task:
- task.read() -> scalar
- task.read(1) -> scalar
- task.read(N) -> 1D list by sample
- Multi-channel task:
- task.read() -> 1D list by channel
- task.read(1) -> 1D list by channel
- task.read(N) -> 2D list by channel, sample
Passing samps_per_chan=1 to task.read() returns a different data type, which may cause errors for programs that don't expect that to happen.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Task.read entry point and compare return shapes for normal AI and power channels with samples_to_read unset, set to 1, and set to N. Use the examples in the issue to define consistent behavior, then add regression coverage for single- and multi-channel reads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100