-
Notifications
You must be signed in to change notification settings - Fork 88
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
Improve usability of get_channel_name in nidigital API #1386
Comments
This does not work. We cannot mix the two concepts. We still need to figure out what to do about these methods though. |
After discussing offline, the proposed solution is: Any module in nimi-python that needs to provide an API for translating channel indices to names will have only one method -
Implementation of NI-Scope C API also contains functions equivalent to nidcpower, nifgen, niswitch Python bindings already have |
… string sequence to comma-delimited string - Rename convert_repeated_capabilities_from_init() to convert_repeated_capabilities_without_prefix(). Other than its current use for option_string in init(), it will be used for indices in get_channel_names() (#1386) and for initial state parameters in apply_levels_and_timing() (#1391) - Update _get_ctype_variable_definition_snippet_for_string() to add case for string input with converter and special case for NOT using converter in init function
… string sequence to comma-delimited string (#1404) * Add codegen support for using converters to convert parameter of type string sequence to comma-delimited string - Rename convert_repeated_capabilities_from_init() to convert_repeated_capabilities_without_prefix(). Other than its current use for option_string in init(), it will be used for indices in get_channel_names() (#1386) and for initial state parameters in apply_levels_and_timing() (#1391) - Update _get_ctype_variable_definition_snippet_for_string() to add case for string input with converter and special case for NOT using converter in init function * Remove the special-case for not using converters in `_init_function` Without the special-case, converters will be called in `_init_function` unnecessarily. This is ok since the any kind of special-casing will add complexity without enough benefit. The redundant call to converters is not a big deal since it happens only once during session init.
Description of issue
Currently, there are two very similar methods in the public API:
get_channel_name()
int
.get_channel_name_from_string()
str
which can be one of the following formats:Proposal:
get_channel_name()
get_channel_name_from_string()
toget_channel_name()
get_channel_name()
usechannels
repeated capability - This will make this method consistent with rest of the API w.r.t. usingchannels
repeated capability and it will allow the implementation to leverage support for ranges,lists,slices etc. that are available for repeated capabilities.The text was updated successfully, but these errors were encountered: