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

Some toolkit function don't work when a feature is indexed with a numpy integer #252

Closed
YakBizzarro opened this issue Jul 30, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@YakBizzarro
Copy link
Collaborator

Description

A code like this will not work and throw a cryptic error

for awg_core in np.arange(2):
    #awg_core = int(awg_core) #WORKAROUND
    device.awgs[awg_core].write_to_waveform_memory(waveforms)

The reason is that awg_core is a numpy.int64 integer, instead of a regular Python integer. As workaround, casting it to int make it working

How to reproduce

Environment info

  • Python version:
  • zhinst-toolkit version:
  • LabOne version:
  • zhinst version:

Device/system information (if applicable)

Additional information

@YakBizzarro YakBizzarro changed the title Some toolkit function don't work when a fature is indexed with a numpy integer Some toolkit function don't work when a feature is indexed with a numpy integer Jul 30, 2023
@tobiasah tobiasah self-assigned this Aug 9, 2023
@tobiasah tobiasah added the bug Something isn't working label Aug 9, 2023
tobiasah added a commit that referenced this issue Aug 10, 2023
The getitem function of NodeList differentiates between integers and nodes as
argument. This guarantees a concistent behaviour. Wether the agrument is an
integer or not needs to be checked. This check now also supports all numpy
types and therefore is more versatile.
tobiasah added a commit that referenced this issue Aug 10, 2023
The getitem function of NodeList differentiates between integers and nodes as
argument. This guarantees a concistent behaviour. Wether the agrument is an
integer or not needs to be checked. This check now also supports all numpy
types and therefore is more versatile.
tobiasah added a commit that referenced this issue Aug 16, 2023
The getitem function of NodeList differentiates between integers and nodes as
argument. This guarantees a concistent behaviour. Wether the agrument is an
integer or not needs to be checked. This check now also supports all numpy
types and therefore is more versatile.
tobiasah added a commit that referenced this issue Aug 16, 2023
The getitem function of NodeList differentiates between integers and nodes as
argument. This guarantees a concistent behaviour. Wether the agrument is an
integer or not needs to be checked. This check now also supports all numpy
types and therefore is more versatile.
@YakBizzarro
Copy link
Collaborator Author

Working as expected with last version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants