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

Unchecked assumptions on attribute type #215

Closed
bwohlberg opened this issue Feb 8, 2022 · 1 comment · Fixed by #220
Closed

Unchecked assumptions on attribute type #215

bwohlberg opened this issue Feb 8, 2022 · 1 comment · Fixed by #220
Assignees
Labels
improvement Improvement of existing code, including addressing of omissions or inconsistencies

Comments

@bwohlberg
Copy link
Collaborator

This line implicitly assumes that A is a LinearOperator

rhs = v + 2 * lam * α * A.adj(W(y))

but according to the typing on the A parameter of the class __init__,
A: Optional[Union[Callable, operator.Operator]] = None,

A may also be a function, which does not have an adj method.

The prox method needs some additional checking to ensure that A is a LinearOperator, raising an exception if it is not.

@bwohlberg bwohlberg added the improvement Improvement of existing code, including addressing of omissions or inconsistencies label Feb 8, 2022
@tbalke
Copy link
Contributor

tbalke commented Feb 8, 2022

Good catch. I'll fix it

@bwohlberg bwohlberg linked a pull request Feb 11, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement of existing code, including addressing of omissions or inconsistencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants