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

Replace ValueError with info attribute with SlycotError #99

Closed
roryyorke opened this issue Apr 10, 2020 · 0 comments · Fixed by #117
Closed

Replace ValueError with info attribute with SlycotError #99

roryyorke opened this issue Apr 10, 2020 · 0 comments · Fixed by #117

Comments

@roryyorke
Copy link
Collaborator

See #84 (comment)

A common pattern in the Slycot code is

        e = ValueError('the number of eigenvalues to be assigned is less than the number of possibly assignable eigenvalues')
        e.info = info
        raise e

The idea is to have a SlycotError class, so that this can be:

    raise SlycotError(msg, info)

instead - that way one can't forget the .info attribute.

I'd have had SlycotError inherit from RuntimeError, but for backward compatibility it should probably be ValueError.

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 a pull request may close this issue.

1 participant