-
Notifications
You must be signed in to change notification settings - Fork 85
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
Implement getpoles for a vector K passed as a parameter #775
Conversation
EDIT: Maybe https://github.com/JuliaControl/ControlSystems.jl/blob/master/src/root_locus.jl#L40 should be replaced with |
Codecov Report
@@ Coverage Diff @@
## master #775 +/- ##
===========================================
+ Coverage 0.00% 95.52% +95.52%
===========================================
Files 3 4 +1
Lines 292 313 +21
===========================================
+ Hits 0 299 +299
+ Misses 292 14 -278
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
It is not clear to me how to test the second test without plotting it. |
Hello and thanks for this PR :)
I'm not sure what you mean with the second test? |
Sorry, badly formulated. I meant this test: https://github.com/JuliaControl/ControlSystems.jl/blob/master/test/test_rootlocus.jl#L5-L9 |
Ah, yeah I didn't know of a good way to test that either. The problem it exposed was that some of the root loci switched at some point, which led to me introducing the hungarian algorithm to prevent it. I think it's okay if we leave it like that, just make sure you have run the plot and it still looks nice and that's probably good enough :) |
Can one test plots in CI? |
yes, but it's very cumbersome. One can test that a plot "looks similar" to a saved plot, but unfortunately, most plotting packages make small changes to the visual appearance of plots between versions such that most naive metrics for plot similarity fail, even though the plot is still correct. We do have a plot test bot that displays a number of test plots in PRs automatically, not sure why that didn't run here. I'll try to activate it so you can see how it works. @JuliaControlBot test-plots |
This is an automated message.
|
Thank you for the explanation, @baggepinnen. Indeed the first plot has both cosmetic changes but also the legend is incorrect. I pushed a commit that re-enables the plot and more importantly, also the roots for Perhaps unrelated: would you consider having a (const) |
Actually, these changes are by choice. While the left plot looks better in this simple case, the code to make it look that way was very fragile when several systems were plotted in the same figure, and different plot backends interpreted latex in different ways. We thus decided to include less custom logic to style the plots in favor of a better worst-case result and less maintenance burden since the logic to keep the plot looking nice had to be updated quite often.
That sounds nice :) We could add this struct as long as we do not break the current interface. Maybe the old plot could be implemented in terms of a plot recipe on the struct. |
OK, I will give it a try. I am not familiar with What does it take to merge this PR with the changes to |
The |
The current implementation ignore the request to compute the roots at specific values of K, instead relying on OrdinaryDiffEq to set the values of K.