# Rubi progress and tests #14756

Merged
merged 51 commits into from Jul 28, 2018
+63,023 −32,256

## Conversation

Projects
None yet
7 participants
Contributor

### asmeurer and others added some commits May 1, 2018

Make lambdify decorator a little faster
I pulled out the common functionality to be evaluated once, and used array()
instead of asarray() (they are equivalent, but array() is faster).

This is a partial fix to #14671. It isn't as fast as it used to be yet. I
don't know how to make the decorator faster, other than code generating the
array wrapping directly, which would require improvements to lambdify to work
(lambdify would need to be able to code generation full Python functions).
Contributor

### ashishkg0022 commented May 30, 2018

 In original test suite for trinomial products there are 5 files. In sympy format I have kept it here. https://github.com/ashishkg0022/rubi-structure/tree/master/test/trinomial . This contains all trinomial tests from the rubi test-suite. I have added test_trinomial_passed in this PR . This contains tests which are passed for trinomial_1 . Almost 600 test have passed for trinomial_1 . I started testing trinomial_2 . Then I encountered with issues like With Function is not handled properly. It should be parsed correctly. Some times Matchpy wrongly matches x with some integer and some small issues. The most important for now is fixing the With issue. Then majority of trinomial_2 should pass.
Contributor

Contributor

### ashishkg0022 commented May 30, 2018

 Also In [1]: from sympy.abc import a,b,c,x, e, d In [2]: b*e - c*d Out[2]: b*e - c*d but in mathematica In[1]:= b*e - c*d Out[1]= -cd+be This results in difference because there is a function PosQ which treats b*e -c*d True and -c*d +b*e False

Contributor

### parsoyaarihant commented May 31, 2018 • edited

 Some times Matchpy wrongly matches x with some integer This should be reported to MatchPy developers. Can you share a sample case where this fails?
Contributor

### parsoyaarihant commented May 31, 2018 • edited

 Regadring difference in output of SymPy and Mathematica, Mathematica sorts the expression canonically. See: http://reference.wolfram.com/language/ref/Orderless.html http://reference.wolfram.com/language/ref/Sort.html You can use Sort in the utility function to address this issue.
Contributor

### ashishkg0022 commented May 31, 2018

 You can use Sort in the utility function to address this issue. It handles rest of the cases . But specifically the case b*e -c*d is not sorted by the Sort function too.
Contributor

### parsoyaarihant commented May 31, 2018

 You can create this as a SymPy issue. We might have to improve the Sort function we already have to take care of this.

Open

Contributor

### Abdullahjavednesar commented Jul 23, 2018

 @ashishkg0022 for those utility functions which you've recently modified have you added relevant tests for all (which probably was failing before)? Although I've seen your work before looks good to me, but if you are missing anywhere just recheck.
Contributor

### ashishkg0022 commented Jul 23, 2018

 Yes, I think I have added test cases for them.
Contributor

### ashishkg0022 commented Jul 23, 2018

 There are some more things that need to be done to improve utility functions. I have opened a separate PR especially for improving utility functions. ( #14956)
Contributor

### ashishkg0022 commented Jul 24, 2018

 I apologise, I have not run pyflakes on it. I was not aware of it (pyflakes). I will run it today and fixed if something is undefined. I will fix it today. Then this can be merged.

Contributor

### ashishkg0022 commented Jul 24, 2018

 Fixed few undefined error using pyflakes.
Member

### certik commented Jul 25, 2018

 @Upabjojr would you mind reviewing this PR please and give it a final +1?
Contributor

### Upabjojr commented Jul 25, 2018

 @ashishkg0022 did you add the instructions on how to run the tests?

### Upabjojr reviewed Jul 25, 2018

 Parsing Rules and Tests ======================= Code for parsing rule and tests are included in sympy. They have been properly explained with steps in `rubi_parsing_guide.md` in parsetools.

#### Upabjojr Jul 25, 2018

Contributor

full path of rubi_parsing_guide.md is better

### Upabjojr reviewed Jul 25, 2018

 @@ -671,6 +671,7 @@ def _doctest(*paths, **kwargs): "sympy/physics/unitsystems.py", # raises deprecation warning "sympy/parsing/latex/_antlr/latexlexer.py", # generated code "sympy/parsing/latex/_antlr/latexparser.py", # generated code "sympy/integrals/rubi/rubi.py"

#### Upabjojr Jul 25, 2018

Contributor

are we blacklisting the doctests as well?

#### ashishkg0022 Jul 25, 2018

Contributor

only for rubi.py, not for utility_functions.
Actually, the loading time is around 10 - 11 minutes. So, travis fails. If nothing happens in 10 minutes, travis fails. So I have blacklisted it.

Contributor

### Upabjojr commented Jul 26, 2018

 I guess the master branch should be merged into this PR.
Contributor

### ashishkg0022 commented Jul 26, 2018

 I guess the master branch should be merged into this PR. I have merged the master branch
Contributor

### ashishkg0022 commented Jul 26, 2018

 The travis failed due to some network error.
Contributor

### Upabjojr commented Jul 26, 2018

 Some of the rubi tests keep failing. For example, test_1_3.py, is it supposed to be like that?
Contributor

### ashishkg0022 commented Jul 26, 2018

 test_1_3.py is from last year. I have not run it due to a large time taken by it. What is the status of newly added test files? Do a lot of them fail?
Contributor

### Upabjojr commented Jul 26, 2018

 Do a lot of them fail? I didn't test them all so far.
Contributor

### ashishkg0022 commented Jul 26, 2018

 Can you please run them all? I have tested them in part. I have not run them all together. Like, when I tested exponentials they passed. But after a week I made some changes in trigo rules and utility functions. So it might be possible very few might fail because of some changes done later. For any new change, it's not possible to run all tests again.
Member

### asmeurer commented Jul 26, 2018

 Regarding the release notes, I accidentally added rubi as a submodule, but since it's been moved to integrals.rubi, the header should just be "integrals" (I've fixed it). c.f. sympy/sympy-bot#16. If there end up being a lot of integrals release notes we can split them up into different subsubmodules like integrals.risch, integrals.rubi, and so on.
Contributor

### Upabjojr commented Jul 27, 2018

 For the rubi_test results: https://gist.github.com/Upabjojr/02cf3005ec995c7401418624a4bc11c7
Contributor

### ashishkg0022 commented Jul 27, 2018

 I saw it. Tests which I have run recently like hyperbolic are passing but a few of trinomials and miscellaneous algebra might be failing. Is there some way I can get a list of all expressions in the test set which are failing?
Contributor

### Upabjojr commented Jul 27, 2018

 You have the line numbers. Some tests are actually still running.
Contributor

### Upabjojr commented Jul 28, 2018

 Shall we merge this PR? I have still two tests of rubi_tests running, so far it's 30 hours. I will update the output once they are all finished.
Contributor

### Upabjojr commented Jul 28, 2018

 @parsoyaarihant @Abdullahjavednesar ok with merging?

### Upabjojr merged commit bccd4f3 into sympy:master Jul 28, 2018 2 checks passed

#### 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
sympy-bot/release-notes The release notes look OK
Details