Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task.read has inconsistent return type between normal AI and power channels #527

Open
bkeryan opened this issue Mar 5, 2024 · 0 comments

Comments

@bkeryan
Copy link
Collaborator

bkeryan commented Mar 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant