-
Notifications
You must be signed in to change notification settings - Fork 127
Added support for std::vector strings in UrDriver #408
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
Added support for std::vector strings in UrDriver #408
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #408 +/- ##
==========================================
+ Coverage 42.94% 42.96% +0.01%
==========================================
Files 99 99
Lines 8642 8659 +17
Branches 1171 1179 +8
==========================================
+ Hits 3711 3720 +9
- Misses 4652 4657 +5
- Partials 279 282 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Thank you for the contribution! I also wanted to do that a couple of times already, it just never wasn't important enough. I'll have to think a bit about potential side effects and we would need to add some tests for this. |
|
I will think about the tests for starters, specially since with this change we are avoiding the error messages occurring when there is no recipe file defined for the driver (which throws an error with a |
Yes, exactly. I think, there should be an error raised when
A warning should be raised if
Do we want to allow e.g. defining the output recipe from a file, but the input recipe from a vector (or vice versa)? My initial answer would be "yes". Tests should then cover all the different permutations and check for the expected success / error. Edit: The above behavior should also be documented in the Configuration struct, so it is clear to users without looking at the tests or the implementation. |
|
improved the logic with your suggestions @urfeex . Only the tests are left. Will try to get them done before the end of this week, but cannot promise it 😅 I made the readRecipe function static public, which design-wise it isn't the most appealing, probably an interface that is in charge of all the system IO (referring to files, not the networking) might be better, but since there aren't many other things that need to be parsed it might be an overkill. |
80ab78a to
7d9ba11
Compare
|
@urfeex Okay, I added some tests to the UrDriver to use the new functionality of the input parsing. Since they are not affecting each other, I made only 1 test for each of the following cases since the input/output are handled independently: only recipe files, only recipe vectors, and both at the same time. |
7d9ba11 to
58a35fe
Compare
4ae9219 to
e11e60b
Compare
urfeex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simplify the logic by always using the vector-based constructor internally. Also note, that an empty / no input recipe is allowed.
You seem to have removed the tests. Adding tests to the UrDriverTest suite should be quite straightforward.
Co-authored-by: Felix Exner <[email protected]>
Co-authored-by: Felix Exner <[email protected]>
Co-authored-by: Felix Exner <[email protected]>
|
Indeed, logic does look cleaner and more correct with your suggestion. I created some test with the UrDriverInit test class type |
565d742 to
37f300f
Compare
and call initRTDE from the inside
urfeex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PabloDArandaR I hope you don't mind me stepping in on this. From my point of view this looks good as it is right now.
|
@PabloDArandaR would you like to change anything on this or is it ready to merge from your side? |
|
@urfeex No problem! I just saw some of my changes were also a bit sloppy. I will take a look to the changes and let you know |
|
Ready to merge |
Since it is a functionality allowed by the RTDEClient, seems reasonable to also add it to the UrDriver.