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

fixed many imports for transformation in parse_expr #21229

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

NtemKenyor
Copy link

@NtemKenyor NtemKenyor commented Apr 2, 2021

  • parsing
    • "Reduced the number of files imported before using parse_expr()"
  • Changes

I worked on the parse_expr() making the end-user import less files.

Using parse_expr is now shorter.

Inline with this issue
"Make parse_expr with transformations easier to type #21226", I decided to help by making the parse_expr much more fun to use.

Before...(This was before i made the change)

from sympy.parsing.sympy_parser import standard_transformations, implicit_multiplication_application
transformations = (standard_transformations + (implicit_multiplication_application,))
parse_expr("2x + 1", transformations=transformations)
2*x + 1

After...(The code base right now)

parse_expr("2x + 1", transformations="all")
2*x + 1

I hope to improve it again based on more feedbacks.

I am here for Google Summer of code but I just felt "in-love" with sympy.

@sympy-bot
Copy link

sympy-bot commented Apr 2, 2021

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

  • parsing
    • "Reduced the number of files imported before using parse_expr()" (#21229 by @NtemKenyor)

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

Click here to see the pull request description that was parsed.
<!-- BEGIN RELEASE NOTES -->

* parsing
  * "Reduced the number of files imported before using parse_expr()"

<!-- END RELEASE NOTES -->

* ## Changes

 I worked on the parse_expr() making the end-user import less files.

Using parse_expr is now shorter.

Inline with this issue
"Make parse_expr with transformations easier to type #21226", I decided to help by making the parse_expr much more fun to use.

Before...(This was before i made the change)

>>>from sympy.parsing.sympy_parser import standard_transformations, implicit_multiplication_application
>>> transformations = (standard_transformations + (implicit_multiplication_application,))
>>> parse_expr("2x + 1", transformations=transformations)
2*x + 1

After...(The code base right now)

>>> parse_expr("2x + 1", transformations="all")
2*x + 1

I hope to improve it again based on more feedbacks.

I am here for Google Summer of code but I just felt "in-love" with sympy.

"""

if type(transformations) is str:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to check that transformations really is "all" and not just a string.

Also, please update the documentation pointing out this option and add a test. The example you showed in the post works well as a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants