-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ParameterExpression.__eq__
to accept comparing a bound expression to a fixed value
#5423
Labels
good first issue
Good for newcomers
help wanted
community contributions welcome. For filters like http://github-help-wanted.com/
Milestone
Comments
kdk
added
the
help wanted
community contributions welcome. For filters like http://github-help-wanted.com/
label
Nov 23, 2020
Hi! I'm new to the community and would like to give it a shot. May I? |
mergify bot
added a commit
that referenced
this issue
Dec 3, 2020
* ParameterExpression.__eq__ takes bound expr == val This is a code update in response to issue #5423 The current implementation of __eq__ method of ParameterExpression class only allows comparison between two parameter expressions. With this update it is possible to compare a bounded parameter expression with a fixed value. If the argument passed to __eq__ is a number: (1) Check that self has no unbound parameters i.e. self.parameters == 0 (2) Check that the value of the sympy expression is equal to the argument Added a test in test/python/circuit/test_parameters.py to check that the comparison with a fixed value works * Updated return type in __eq__ docstring The return type is now specifically mentioned to be a bool * Replace else block in __eq_ and add release note As per the suggestion in the PR #5444 thread, the else statement in the __eq__ method is now replaced with just a return statement, since it is simpler and equivalent A release note about the PR is also now added. Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Is this issue closed by #5444 ? |
This is added in #5444 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
good first issue
Good for newcomers
help wanted
community contributions welcome. For filters like http://github-help-wanted.com/
It would be good to update
ParameterExpression.__eq__
to accept comparing a bound expression to a fixed value, but this can be a separate issue.Originally posted by @kdk in #5192 (comment)
The text was updated successfully, but these errors were encountered: