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

Adding UnevaluatedExpr() Tutorial #12232

Merged
merged 14 commits into from
Mar 2, 2017
Merged

Conversation

mohit3011
Copy link
Contributor

This Pull Request Fixes #12230

@mohit3011
Copy link
Contributor Author

@Upabjojr , please review the changes . Thanks

@Upabjojr
Copy link
Contributor

I would put the code here:
https://github.com/sympy/sympy/blob/master/doc/src/tutorial/manipulation.rst

(Advanced expression manipulation).

@Upabjojr
Copy link
Contributor

@mohit3011
Copy link
Contributor Author

@Upabjojr , I have changed it according to you, please review it . Thanks

@Upabjojr
Copy link
Contributor

Strange... Travis did not start.

@@ -483,3 +483,49 @@ traversals easy. We could have also written our algorithm as
have ``-x`` or ``1/x``. It is also done for speed efficiency because
singletonized objects can be compared by ``is``. The unique objects for
each singletonized class can be accessed from the ``S`` object.

``UnevaluatedExpr``
===================
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tutorial should not be about the class UnevaluatedExpr, rather about generic methods to keep expressions unevaluated. I think we should also mention evaluate=False.

@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 1, 2017

Added some fixes. Tests are probably still failing.

@mohit3011
Copy link
Contributor Author

@Upabjojr , do you know why the tests are failing ?

@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 1, 2017

do you know why the tests are failing ?

Your example outputs are wrong.

@mohit3011
Copy link
Contributor Author

I checked it on terminal in sympy , it can't be wrong

@Yathartha22
Copy link
Member

Yathartha22 commented Mar 1, 2017

  • line 520 the result should be 2*x since the expr variable has not been updated it still has a value of x + x.
  • line 526 the result should be (5/7)*(3/4)
  • line 531 the result should be x*1/x
  • line 539 should be 2*x
    I guess these are the issues in the doc.

@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 1, 2017

I checked it on terminal in sympy , it can't be wrong

Maybe you use a different printer.

@mohit3011
Copy link
Contributor Author

I have updated the examples

@mohit3011
Copy link
Contributor Author

@Upabjojr , I checked all the examples once again . There doesn't seem any error in those . I would like to point to core.rst , because I am not really sure about that.
One more thing Since the examples are on continuous basis , so are we assumming that once we import certain class from sympy then we can use it in all example or we have to import it every time.

@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 1, 2017

https://travis-ci.org/sympy/sympy/jobs/206607119

There is still a minor problem. If tests fail, just click on the X near the commit hashtag to see why.

once we import certain class from sympy then we can use it in all example or we have to import it every time.

The doctests are generally sequential while executing the code, so different blocks are treated sequentially in every test. I think it's on a class-level or RST module-level (that is, higher scope is not sequential anymore), but I'm not so sure.

@mohit3011
Copy link
Contributor Author

mohit3011 commented Mar 1, 2017

@Upabjojr , I don't know why but the travis test is not opening up . This problem has been persistent since last night.

@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 1, 2017

I don't know why but the travis test is not opening up . This problem has been persistent since last night.

Yeah, I think there's some problems with Travis today. I was able to access it one hour ago.

Otherwise, run the tests locally.

@mohit3011
Copy link
Contributor Author

@Upabjojr , now I think its fine. One runtime error is due to some other module, I guess.

@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 1, 2017

Warning, treated as error:
/home/travis/build/sympy/sympy/doc/src/tutorial/manipulation.rst:471: WARNING: Title underline too short.

That's our file. We need a shorter title.

@mohit3011
Copy link
Contributor Author

@Upabjojr , finally :)

@mohit3011
Copy link
Contributor Author

@Upabjojr , how can I run doc tests locally , because I can only see an error related to job time limit exceeded on Travis . Thanks

@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 2, 2017

how can I run doc tests locally , because I can only see an error related to job time limit exceeded on Travis . Thanks

I think that this time Travis had a spurious failure. Restarted.

There is a directory bin in SymPy with scripts to run the tests.

@mohit3011
Copy link
Contributor Author

@Upabjojr , I have run tests for other modules from bin by using the command like python bin/test "module_name" for testing "module_name".py but for running doc test what should I write ?

@Upabjojr Upabjojr merged commit b0cd981 into sympy:master Mar 2, 2017
@Upabjojr
Copy link
Contributor

Upabjojr commented Mar 2, 2017

I have run tests for other modules from bin by using the command like python bin/test "module_name" for testing "module_name".py but for running doc test what should I write ?

One of those scripts calls the command, just look at the code.

@mohit3011 mohit3011 deleted the Fixes#12230 branch March 2, 2017 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants