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

Core: vector symbols and expressions #971

Merged
merged 7 commits into from
Mar 5, 2025

Conversation

alesanter
Copy link
Collaborator

No description provided.

raise TypeError(f"Norm {norm} must be an Expr, got {type(norm).__name__}.")

try:
is_non_negative = bool(norm >= 0)
Copy link
Owner

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?

Copy link
Collaborator Author

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?

Copy link
Owner

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):
Copy link
Owner

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.

@blackyblack blackyblack merged commit e55cbbd into master Mar 5, 2025
1 check passed
@blackyblack blackyblack deleted the core-new-coordinate-systems-1 branch March 5, 2025 13:40
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.

2 participants