nimi-python icon indicating copy to clipboard operation
nimi-python copied to clipboard

Error in IVI session options mapping

Open Arkh42 opened this issue 11 months ago • 0 comments

Description of issue

In the construction or Session, the dictionary options is processed by a non-public converter object: _converters.convert_init_with_options_dictionary. This is basically a mapping to convert the keys from the dictionary into other keys suitable for the driver.

The issue is related to the following keys:

  • query_instrument_status, which is not processed because in the converter's mapping it does not exist as is (we have queryinstrstatus or query_instr_status);

  • record_value_coersions, for two reasons

    1. there is a typo in the documented key name (docstring), as it should be record_value_coercions;
    2. in either case, it will never be processed because in the converter's mapping it does not exist as is (we have recordcoercions or record_coercions)

System report

The following error is raised when we pass the query_instrument_status: False option:

Driver error: -1074134965: IVI: The option string parameter contains an entry with an unknown option name/

query_instrument_status.

Steps to reproduce issue

import nidcpower

ivi_session_options = {
    cache=True,
    interchange_check=False,
    query_instrument_status = False,
    range_check=True,
    record_value_coersions = False,
    simulate=True,
}

instrument_session = nidcpower.Session(
    resource_name='PXI1Slot2',
    channels=None,
    reset=True,
    options=ivi_session_options,
    independent_channels=True
)
  1. Prepare one of the faulty option, as described above.
  2. Initialise a Session with the faulty option.
  3. Observe the error.

Arkh42 avatar Mar 25 '25 10:03 Arkh42