-
Notifications
You must be signed in to change notification settings - Fork 15
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
Core: vector symbols and expressions #971
Conversation
raise TypeError(f"Norm {norm} must be an Expr, got {type(norm).__name__}.") | ||
|
||
try: | ||
is_non_negative = bool(norm >= 0) |
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.
Why not use is_negative
flag?
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 opted in for ask(Q.negative(...))
in the end. Is .is_negative
defined on all expressions?
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.
No idea. Probably not.
if isinstance(value, (Add, Mul)): | ||
# NOTE: `p` is not needed for `_needs_mul_brackets`, we could refactor it out of the | ||
# `SymbolCodePrinter` class. | ||
if SymbolCodePrinter._needs_mul_brackets(p, value, last=True): |
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.
Eventually I'd like to have this helper method extracted somewhere. Pylint will warn about using protected method here.
No description provided.