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

Add codegen support for using converters to convert parameter of type string sequence to comma-delimited string #1404

Merged
merged 2 commits into from
Apr 15, 2020

Conversation

sbethur
Copy link
Contributor

@sbethur sbethur commented Apr 13, 2020

- [ ] I've updated CHANGELOG.md if applicable.

  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

List issues fixed by this Pull Request below, if any.

What testing has been done?

Added new unit tests. Ran all unit tests. CI will run system tests.

… 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
@codecov
Copy link

codecov bot commented Apr 13, 2020

Codecov Report

Merging #1404 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1404      +/-   ##
==========================================
+ Coverage   91.88%   91.90%   +0.01%     
==========================================
  Files          20       20              
  Lines        3637     3642       +5     
==========================================
+ Hits         3342     3347       +5     
  Misses        295      295              
Flag Coverage Δ
#codegenunittests 88.24% <100.00%> (+0.03%) ⬆️
#nifakeunittests 96.36% <100.00%> (ø)
#nimodinstunittests 95.37% <ø> (ø)
#nitclkunittests 95.45% <ø> (ø)
Impacted Files Coverage Δ
build/helper/codegen_helper.py 92.44% <100.00%> (+0.08%) ⬆️
generated/nifake/nifake/_converters.py 96.61% <100.00%> (ø)
generated/nifake/nifake/session.py 97.67% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcf6d22...2a8eb1d. Read the comment docs.

build/helper/codegen_helper.py Outdated Show resolved Hide resolved
build/helper/codegen_helper.py Outdated Show resolved Hide resolved
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.
@sbethur sbethur dismissed marcoskirsch’s stale review April 14, 2020 17:43

Addressed comments

@sbethur sbethur requested a review from marcoskirsch April 14, 2020 17:43
Copy link
Member

@marcoskirsch marcoskirsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good but we need to add an NI-FAKE test case specifically testing using a converter in this way in a parameter.

Copy link
Contributor

@texasaggie97-zz texasaggie97-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having a nifake test for the parameter would be nice, but I think the usage in the generated init function (not __init__) also proves it is working.

@marcoskirsch marcoskirsch dismissed their stale review April 15, 2020 01:55

Mark said: "I think having a nifake test for the parameter would be nice, but I think the usage in the generated init function (not init) also proves it is working."

@marcoskirsch marcoskirsch merged commit 6d4117a into master Apr 15, 2020
@marcoskirsch marcoskirsch deleted the bug1401/codegen_support_for_string_converters branch April 15, 2020 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add codegen support for using converters to convert string sequence to comma-delimited string
3 participants