Skip to content

change root precision tolerance and imaginary detection in xferfcn._common_den() #345

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

Merged
merged 4 commits into from
Dec 30, 2019

Conversation

bnavigator
Copy link
Contributor

@coveralls
Copy link

coveralls commented Nov 9, 2019

Coverage Status

Coverage decreased (-2.8%) to 80.965% when pulling 712f78a on bnavigator:fix-armfail into a4b4c43 on python-control:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.3%) to 80.447% when pulling d09472c on bnavigator:fix-armfail into a4b4c43 on python-control:master.

@murrayrm murrayrm marked this pull request as ready for review November 17, 2019 18:17
@murrayrm
Copy link
Member

I don't understand why the unit test coverage is going down so much as a result of these changes.

Everything looks OK; will merge in a few days unless anyone has objections.

@jgspiro
Copy link

jgspiro commented Nov 18, 2019

I don't understand why the unit test coverage is going down so much as a result of these changes.

Everything looks OK; will merge in a few days unless anyone has objections.

Coverage : I don't understand it fully either, after comparing the results of the last master build vs. this pull request.

Coveralls might be giving down points because the newly added warn statement is untested.

@bnavigator
Copy link
Contributor Author

Coverage goes down because the new warning line about the nontrivial imaginary part is not reached by the test.

The more I think about it, I don't like the way the function discards the imaginary part. There should still be a warning that the result has imaginary coefficients, because the SLICOT routines asking for a common den cannot handle it, but they should not be discarded.

Also I would like to get rid of the tol_imag parameter. It does not do what the documentation says it does. It is not used within python-control and changing the parameters of an internal function should not break any external programs.

I would like to write some more extensive unit tests to check the proper calculation of common denominators and also the warnings before this is to be merged.

@murrayrm
Copy link
Member

Coverage goes down because the new warning line about the nontrivial imaginary part is not reached by the test.

This would explain coverage going down a small amount, but 3% (of the entire code base)? Seems off.

I agree on the desire to do something sensible with tol_imag. Will hold on merging this PR for now.

@murrayrm murrayrm added the onhold Waiting for changes or input label Nov 18, 2019
@bnavigator
Copy link
Contributor Author

bnavigator commented Nov 18, 2019

I think it is because some of the configured travis jobs without slycot skip most unit tests. (#349)

Benjamin Greiner added 2 commits November 27, 2019 17:59
renamed the np variable because that is used as numpy otherwise
@bnavigator
Copy link
Contributor Author

bnavigator commented Nov 27, 2019

I made some modifications and added an unit test. Please review.

imag_tol is now used as originally intended and documented. The algorithm now checks for equality to known poles based on sqrt(eps), because they are the roots of the polynomial coefficients. Thus, the precision error from the coefficients eps propagates to the larger value sqrt(eps).

Copy link
Member

@murrayrm murrayrm left a comment

Choose a reason for hiding this comment

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

Reviewed the code. Changes look good.

@murrayrm
Copy link
Member

Confirmed that unit tests are working with PR #353 => ready to merge.

@murrayrm murrayrm removed the onhold Waiting for changes or input label Dec 29, 2019
@murrayrm murrayrm added this to the 0.8.3 milestone Dec 29, 2019
@murrayrm murrayrm merged commit cb25633 into python-control:master Dec 30, 2019
@bnavigator bnavigator deleted the fix-armfail branch July 26, 2020 14:38
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.

4 participants