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

niswitch.Session doesn't support specifying an options dictionary or driver setup string #1959

Open
bkeryan opened this issue May 2, 2023 · 3 comments
Labels

Comments

@bkeryan
Copy link
Contributor

bkeryan commented May 2, 2023

Description of issue

niswitch.Session doesn't support specifying an options dictionary like the other drivers. Instead, it has parameters for simulate and topology.

Impact:

  • Enabling session-based simulation requires different code than for the other drivers. (Note: if it supported options, you would still have to specify the topology key instead of the model key.)
  • Specifying options other than simulate or driver setup keys other than topology is unsupported.

System report

python -c "import niswitch; niswitch.print_diagnostic_information()" output

OS:
    Name:      Windows
    Version:   10.0.19045
    Bits:      64
Driver:
    Name:      NI-SWITCH
    Version:   22.8.0.49295
Module:
    Name:      niswitch
    Version:   1.4.4
Python:
    Version:   3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
    Bits:      64
    Is_Venv:   True
    Installed Packages:
        click==8.1.3
        colorama==0.4.6
        grpcio==1.54.0
        hightime==0.2.1
        mypy==1.2.0
        mypy-extensions==1.0.0
        ni-measurementlink-service==1.0.1
        niswitch==1.4.4
        pip==23.0.1
        protobuf==4.22.3
        pywin32==303
        setuptools==67.6.1
        tomli==2.0.1
        typing-extensions==4.5.0
        wheel==0.40.0

Steps to reproduce issue

>>> import niswitch
>>> session = niswitch.Session(resource_name="", options={"simulate": True, "driver_setup": {"topology": "2567/Independent"}})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'options'
@ni-jfitzger
Copy link
Collaborator

This issue isn't unique to the Python API.

@bkeryan
Copy link
Contributor Author

bkeryan commented Jun 26, 2023

@ni-jfitzger Are you referring to the .NET API? C and LV have niSwitch_InitWithOptions which supports specifying the topology as well as other options.

@ni-jfitzger
Copy link
Collaborator

Sorry, I meant this part, specifically, is not unique to the Python API.

Note: if it supported options, you would still have to specify the topology key instead of the model key.)

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

No branches or pull requests

2 participants