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

[GSoC]Change return type of P and E with evaluate=False #19819

Merged
merged 4 commits into from
Jul 26, 2020

Conversation

Smit-create
Copy link
Member

@Smit-create Smit-create commented Jul 22, 2020

References to other Issues or PRs

Fixes #19798

Brief description of what is fixed or changed

Change in the return types of P and E with evaluate=False. Examples:

>>> from sympy.stats import *
>>> X = Normal('X',1,2)
>>> P(X > 1, evaluate=False)
Probability(X > 1)
>>> E(X, evaluate=False)
Expectation(X)

Other comments

Release Notes

  • stats
    • Change in return type of P and E with evaluate=False. With evaluate=False, P and E are made to return Probability and Expectation object respectively.

ping @czgdp1807 @Upabjojr @jmig5776

@sympy-bot
Copy link

sympy-bot commented Jul 22, 2020

Hi, I am the SymPy bot (v160). 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:

  • stats
    • Change in return type of P and E with evaluate=False. With evaluate=False, P and E are made to return Probability and Expectation object respectively. (#19819 by @Smit-create)

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

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://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->
Fixes #19798

#### Brief description of what is fixed or changed
Change in the return types of P and E with `evaluate=False`. Examples:
```py
>>> from sympy.stats import *
>>> X = Normal('X',1,2)
>>> P(X > 1, evaluate=False)
Probability(X > 1)
>>> E(X, evaluate=False)
Expectation(X)
```

#### Other comments


#### 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 -->
* stats
   * Change in return type of `P` and `E` with `evaluate=False`. With `evaluate=False`, `P` and `E` are made to return `Probability` and `Expectation` object respectively.
<!-- END RELEASE NOTES -->
ping @czgdp1807 @Upabjojr @jmig5776 

Update

The release notes on the wiki have been updated.

@Smit-create Smit-create changed the title fix issue 19798 to change return type of evaluate=False [GSoC]Change return type of P and E with evaluate=False Jul 22, 2020
@codecov
Copy link

codecov bot commented Jul 22, 2020

Codecov Report

Merging #19819 into master will increase coverage by 0.008%.
The diff coverage is 100.000%.

@@              Coverage Diff              @@
##            master    #19819       +/-   ##
=============================================
+ Coverage   75.722%   75.730%   +0.008%     
=============================================
  Files          664       664               
  Lines       172376    172483      +107     
  Branches     40653     40678       +25     
=============================================
+ Hits        130527    130623       +96     
- Misses       36146     36158       +12     
+ Partials      5703      5702        -1     

sympy/stats/rv.py Outdated Show resolved Hide resolved
sympy/stats/rv.py Outdated Show resolved Hide resolved
@Smit-create
Copy link
Member Author

@czgdp1807 @Upabjojr Please have a look if it looks good to merge.

sympy/stats/tests/test_continuous_rv.py Outdated Show resolved Hide resolved
sympy/stats/rv.py Show resolved Hide resolved
@czgdp1807
Copy link
Member

LGTM. @Upabjojr Should we merge this?

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.

stats: Should P(X > 1, evaluate=False) return Probability(X > 1) or unevaluated Integral?
4 participants