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

Replace solve with solveset in sympy.stats #9710

Merged
merged 5 commits into from Jul 25, 2015

Conversation

Projects
None yet
3 participants
@aktech
Copy link
Member

aktech commented Jul 21, 2015

TODO

  • crv.py
  • drv.py
  • rv.py
  • Remove solve imports

Partial fix for #8711

@hargup @flacjacket

@aktech aktech changed the title Stats replace solve with solveset in sympy.stats Replace solve with solveset in sympy.stats Jul 21, 2015

@aktech aktech self-assigned this Jul 21, 2015

@@ -181,7 +182,9 @@ def _inverse_cdf_expression(self):
x, z = symbols('x, z', real=True, positive=True, cls=Dummy)
# Invert CDF
try:
inverse_cdf = solve(self.cdf(x) - z, x)
inverse_cdf = solveset(self.cdf(x) - z, x)
if isinstance(inverse_cdf, Intersection) and inverse_cdf.args[0] == S.Reals:

This comment has been minimized.

@hargup

hargup Jul 21, 2015

Member

Is it necessary that S.Reals would appear at 0th position? A better alternative would be

S.Reals in inverse_cdf.args

This comment has been minimized.

@aktech

aktech Jul 21, 2015

Author Member

Is it necessary that S.Reals would appear at 0th position?

Yes, though the alternative looks better.

This comment has been minimized.

@aktech

aktech Jul 22, 2015

Author Member

Doing this raises

SymPyDeprecationWarning:
is_real has been deprecated since SymPy 0.7.6. Use is_subset(S.Reals)

and the test fails.

This comment has been minimized.

@aktech

aktech Jul 22, 2015

Author Member

Shall I undo the last commit?

This comment has been minimized.

@hargup

hargup Jul 22, 2015

Member

There shouldn't be an error or warning, can you investigate more and let me know?

This comment has been minimized.

@aktech

aktech Jul 22, 2015

Author Member

Yes, sure.


gs = solveset(expr - y, self.value)

if isinstance(gs, Intersection) and gs.args[0] == S.Reals:

This comment has been minimized.

results = solve(condition, rv)

results = solveset(condition, rv)
if isinstance(results, Intersection) and results.args[0] == S.Reals:

This comment has been minimized.

@aktech aktech added the GSoC label Jul 24, 2015

@aktech

This comment has been minimized.

Copy link
Member Author

aktech commented Jul 25, 2015

hargup added a commit that referenced this pull request Jul 25, 2015

Merge pull request #9710 from aktech/stats-replace-solve
Replace solve with solveset in sympy.stats

@hargup hargup merged commit 7aa8d4a into sympy:master Jul 25, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hargup

This comment has been minimized.

Copy link
Member

hargup commented Jul 25, 2015

+1

@aktech aktech deleted the aktech:stats-replace-solve branch Jul 25, 2015

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 29, 2015

solve tests need to stay.

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 29, 2015

Ignore last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment