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

Improper handling of plot for constant function #133

Open
povinsahu1909 opened this issue Mar 15, 2020 · 6 comments
Open

Improper handling of plot for constant function #133

povinsahu1909 opened this issue Mar 15, 2020 · 6 comments

Comments

@povinsahu1909
Copy link

In case of plotting constant function instead of producing a horizontal line as output, sympygamma was redirected to error page.
And because of this, there was an error when plotting an expression that results in constant term.

IMO, this can be improved by using updated modules from sympy rather than using the currently used modules.

@Mathbone
Copy link

This appears to have been fixed with the new upgrade to Python 3?

@oscarbenjamin
Copy link

What would you type into sympy gamma to test this?

@Mathbone
Copy link

plot(y=3)

Seems to be what they were implying, though admittedly my testing was not extremely thorough.

@Mathbone
Copy link

After a little more testing I see what the issue is: The system can't handle things like plot(3) so if the user is entering things that they don't know simplify to a constant (e.g. (plot((2x+3)-2x)), they get an unhelpful error. If they had instead entered plot(y=(2x+3)-2x) they receive the proper plot, but in the long run this seems to put too much syntax burden on the user for a system patterned on the "natural language/Wolfram" model.

@Mathbone
Copy link

I'm new to open source. Does this seem like a good first issue to contribute on?

I poked around in the code and I'm worried I might come up against a foundational issue because it seems like the decision was made to have the system "forget" about the variables in the expression the user originally typed before generating the cards. My first thought to resolve it would have been to check whether the parser had detected variables, and prefer the plot if variables were present.

@oscarbenjamin
Copy link

It could be a good first issue. I don't know the sympy gamma codebase at all and I'm not sure who can advise. Maybe @aktech?

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

No branches or pull requests

3 participants