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

In nidigital Session.__init__(), get rid of id_query argument

Open sbethur opened this issue 5 years ago • 7 comments

Description of issue

In C API, documentation for IDQuery argument to niDigital_InitWithOptions says:

A Boolean that verifies that the digital pattern instrument you initialize is supported by NI-Digital. NI-Digital automatically performs this query, so setting this parameter is not necessary.

Seems like we can remove this argument from Session.init().

sbethur avatar Oct 31 '19 20:10 sbethur

We should, none of the other nimi-python drivers expose this because it has no effect on NI drivers. It is an IVI consideration applicable to boxed instruments.

marcoskirsch avatar Nov 13 '19 22:11 marcoskirsch

We don't actually remove them because that would mess up the code generation to call into the DLL. What we do is give these types of parameters a default value. This is already done for nidigital.

def __init__(self, resource_name, id_query=False, reset_device=False, options={}):
    ...
    self._vi = self._init_with_options(resource_name, id_query, reset_device, options)

texasaggie97-zz avatar Nov 14 '19 00:11 texasaggie97-zz

Can we make the method fancy and truly remove it from the parameter list?

sbethur avatar Nov 14 '19 15:11 sbethur

Or change the code-generator so that we can specify parameters to remove from the public API and default values for the underlying ctypes call into the Library?

marcoskirsch avatar Nov 14 '19 18:11 marcoskirsch

Do we really want to remove them?

If we remove them for all drivers we may break customers that have set them. If we only remove them for nidigital, then nidigital is different from the rest.

texasaggie97-zz avatar Jan 07 '20 20:01 texasaggie97-zz

@marcoskirsch, should we move this to "2.0 Source Breakers" milestone?

sbethur avatar Mar 19 '20 16:03 sbethur

Shreyas, yes let’s do that.

marcoskirsch avatar Mar 23 '20 02:03 marcoskirsch