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

Fix bug in ask related to custom AskHandler #18204

Merged
merged 4 commits into from
Jan 3, 2020
Merged

Fix bug in ask related to custom AskHandler #18204

merged 4 commits into from
Jan 3, 2020

Conversation

mcpl-sympy
Copy link
Contributor

@mcpl-sympy mcpl-sympy commented Jan 2, 2020

References to other Issues or PRs

Fixes #18106

Brief description of what is fixed or changed

Added except KeyError: pass condition in ask.

Other comments

This commit fixes bug in passing custom AskHandler as assumption of ask.

Release Notes

  • assumptions
    • Improved code in ask function using constructs from cnf module.
    • Fixed bug in ask function: In case of user-defined Predicates it generated KeyError while checking for local_facts. Now falls back to Handlers and satask.

@sympy-bot
Copy link

sympy-bot commented Jan 2, 2020

Hi, I am the SymPy bot (v149). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • assumptions
    • Improved code in ask function using constructs from cnf module. (#18204 by @JSS95 and @mcpl-sympy)

    • Fixed bug in ask function: In case of user-defined Predicates it generated KeyError while checking for local_facts. Now falls back to Handlers and satask. (#18204 by @JSS95 and @mcpl-sympy)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.6.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->
Fixes #18106


#### Brief description of what is fixed or changed

Added `except KeyError: pass` condition in `ask`.

#### Other comments

This commit fixes bug in passing custom AskHandler as assumption of `ask`.

#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->

* assumptions
    * Improved code in ask function using constructs from cnf module.
    * Fixed bug in ask function: In case of user-defined Predicates it generated KeyError while checking for local_facts. Now falls back to Handlers and satask.

<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@mcpl-sympy mcpl-sympy changed the title Fix bug in ask related to custom AssumptionHandler Fix bug in ask related to custom AskHandler Jan 2, 2020
@codecov
Copy link

codecov bot commented Jan 2, 2020

Codecov Report

Merging #18204 into master will increase coverage by 0.032%.
The diff coverage is 83.333%.

@@              Coverage Diff              @@
##            master    #18204       +/-   ##
=============================================
+ Coverage   74.936%   74.968%   +0.032%     
=============================================
  Files          642       642               
  Lines       167128    167122        -6     
  Branches     39331     39324        -7     
=============================================
+ Hits        125240    125289       +49     
+ Misses       36351     36294       -57     
- Partials      5537      5539        +2

JSS95 and others added 2 commits January 2, 2020 16:37
Co-authored-by: Shubham Kumar Jha <skjha832@gmail.com>
Co-authored-by: Shubham Kumar Jha <skjha832@gmail.com>
@ShubhamKJha
Copy link
Member

Looks good to me. Will merge if no one objects.

@ShubhamKJha
Copy link
Member

I am merging it now. Thanks for your contribution.

@ShubhamKJha ShubhamKJha merged commit b4f1aa3 into sympy:master Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ask function needs except KeyError: condition
6 participants