Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:56
    akshanshbhatt review_requested #21703
  • 15:41
    prathameshbhole synchronize #21797
  • 15:37
    prathameshbhole synchronize #21797
  • 15:34
    prathameshbhole synchronize #21797
  • 15:18
    oscarbenjamin commented #21800
  • 15:11
    sympy-bot commented #21703
  • 15:11
    akshanshbhatt edited #21703
  • 15:10
    delgh1 commented #21800
  • 15:10
    delgh1 closed #21800
  • 15:07
    akshanshbhatt commented #21703
  • 15:06
    akshanshbhatt edited #21703
  • 15:05
    sympy-bot commented #21703
  • 15:05
    akshanshbhatt edited #21703
  • 14:56
    akshanshbhatt synchronize #21703
  • 14:36
    github-actions[bot] commented #21801
  • 13:33
    oscarbenjamin commented #21800
  • 13:18
    sympy-bot commented #21801
  • 13:18
    praneethratna opened #21801
  • 12:49
    delgh1 opened #21800
  • 10:02
    tianpi starred sympy/sympy
Kalevi Suominen
@jksuom
'\\pi' is the representation of the (internal) Python string created by latex(pi). You can use print(latex(pi)) to see how the output will appear in the LaTeX source.
Divyam Sharma
@divyam102
what level of python is required in order to contribute for sympy?
Bjorn
@bjodah

I'm trying to hunt down where in my code I'm using a now deprecated sympy function. I'm using pytest & python 3.7 and I'm looking at the python docs. This should work, but I can't seem to make it trigger:

$ PYTHONWARNINGS='ignore,error:::sympy' PYTHON=python3.7 PYTHONPATH=~/vc/sympy ./scripts/run_tests.sh chempy/util/pyutil.py
==== 6 passed, 1 skipped in 0.53 seconds ====
/home/bjorn/vc/sympy/sympy/matrices/matrices.py:2491: SymPyDeprecationWarning: 

Dot product of non row/column vectors has been deprecated since SymPy
1.2. Use * to take matrix products instead. See
https://github.com/sympy/sympy/issues/13815 for more info.

  useinstead="* to take matrix products").warn()

if I change the PYTHONWARNINGS environment variable to simply error::DeprecationWarning it triggers way before actually running the tests:

Traceback (most recent call last):
...
  File "/opt/py37/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 6, in <module>
    import imp
  File "/opt/py37/lib/python3.7/imp.py", line 33, in <module>
    DeprecationWarning, stacklevel=2)
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

does anyone know the proper syntax to specifically turn SymPy warnings into errors?

(I also tried PYTHONWARNINGS='ignore,error::DeprecationWarning:sympy' and a few other combinations to no avail)
Aaron Meurer
@asmeurer
I think use SymPyDeprecationWarning instead of DeprecationWarning
Bjorn
@bjodah
Thanks, tried that too, it spits out Invalid -W option ignored: unknown warning category: 'SymPyDeprecationWarning' and tests still pass.
Aaron Meurer
@asmeurer
Really it has to be a known category?
Bjorn
@bjodah
Looks like it, also tried:
PYTHONWARNINGS='error:::sympy[.*]'
PYTHONWARNINGS='error::DeprecationWarning:sympy[.*]'
Aaron Meurer
@asmeurer
Well warnings.filterwarnings should work. I think we use that in SymPy itself
I guess you'll have to use that and run the tests from within Python.
Ok apparently you have to specify warnings from external modules with a module name, like sympy.SymPyDeprecationWarning
But it looks like it doesn't work because you have to import it from sympy.utilities.exceptions.
And -W"error::sympy.utilities.exceptions.SymPyDeprecationWarning" gives Invalid -W option ignored: invalid module name: 'sympy.utilities.exceptions'
Maybe I'm doing it wrong.
Bjorn
@bjodah
Don't know, to me it looks right (but this is all new to me, hence me asking here). I'll use filterwarnings (or just edit matrix.py for a sec to throw). Would've been nice if this worked.
Aaron Meurer
@asmeurer
I don't know. Based on the code from https://github.com/python/cpython/blob/3.7/Lib/warnings.py#L239, -W"error::sympy.utilities.exceptions.SymPyDeprecationWarning" should work
Does it work for you?
Bjorn
@bjodah
No, I can't get it to trigger. Unsure if py.test might have something to do with it though
Aaron Meurer
@asmeurer
You can open an issue about it. I think at the very least we should move SymPyDeprecationWarning into __init__.py.
Bjorn
@bjodah
submitted #15130
Ashwin Shenoy
@Ultra-Instinct-05
Hello, everyone ! I was going through the workflow & came across the guidelines for writing commit messages. sympy/sympy@bf0e81e
Is it really necessary to write an example for the commit message ?
I understand the description is important.
Ashwin Shenoy
@Ultra-Instinct-05
Also, for the evolute of an ellipse, I can't see any test case added. Do the methods returning a sympy expression don't need a test case ?
Ayushman Koul
@ayushmankoul
Hello everyone.My name is Ayushman Koul and I am a 3rd year student studying Computer Engineering at GCET Jammu. I wish to participate in GSOC 2019 through Sympy and contribute to the community as much as I can.@hetp111 From my personal experience I would suggest you to take https://in.udacity.com/course/how-to-use-git-and-github--ud775-india course to have better understanding .
Ayushman Koul
@ayushmankoul
@asmeurer Sir I am interested in working on this project idea Please provide me the guidance how should I proceed further on this project.
Kalevi Suominen
@jksuom
@ayushmankoul It seems to me that the project idea text is outdated. Most of it has already been implemented in the factortools module except what is suggested in the last sentence: "You can go further and extend...". Algorithms for that part may not be easily available in the literature, if at all.
Ayushman Koul
@ayushmankoul
@jksuom Thank You sir for responding.When will be the GSoC ideas page be updated since some projects may have been completed during this year GSoC ?
Kalevi Suominen
@jksuom
The ideas page should be updated after some work has been done but it is often forgotten. That is voluntary work that could be done by anyone, there is no fixed timetable. If you are unsure about the status of a GSoC idea, it is probably best to ask questions here.
francesco
@cescor80_twitter
Hi, I'm trying to solve a nonlinear symbolic equation, but sympy-1.2 gets stuck (it has been running for half an hour now). The code is:
from sympy import
A,B,X,Y=symbols('A B X Y')
eq1=(B
X - 1/(BX))/(A + BX + 1/(BX)) + (-BY + 1/(BY))/(A + BY + 1/(BY))
eq2=(B
Y - 1/(BY))/(A + BY + 1/(BY)) + (-B/(XY) + XY/B)/(A + B/(XY) + X*Y/B)
nonlinsolve([Eq(eq1), Eq(eq2)], [X, Y])
Any idea?
Ethan Ward
@ethankward
@cescor80_twitter do you actually need a symbolic solution? nsolve seems to work very well here
Ethan Ward
@ethankward
(given specific values for A and B)
Ayushman Koul
@ayushmankoul
@jksuom Sure sir and Thank You for responding to my question.I was working on this sympy/sympy#15117 and struck into assertion error while enclosing every base in {} as asked by mentor.Can anyone please help me in figuring out this ?
Kalevi Suominen
@jksuom
I think that an extra pair of braces will do no harm in LaTeX. You could edit the asserted lines to conform to the new output (by adding { and } in suitable places).
Ayushman Koul
@ayushmankoul
I will give it another try if I face any issue will let you know.Thank You sir @jksuom
V Gladkova
@valglad
Got a strange error in this build. In Python 2.7 and 3.6 insympy/printing/tests/test_theanocode.py[27] the error is
"""
/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/theano/gof/opt.py:251: UserWarning: WARNING: Supervisor is not added. Please build a FunctionGraphvia theano.compile.function_module.std_graph()or add the Supervisor class manually.
sub_prof = optimizer.optimize(fgraph)
"""
Is this just a Travis thing?
Bjorn
@bjodah
I think the warning is real and it indicates that the Theano-code generated by SymPy is not optimal (or even correct?). Maybe worth making an issue for it (then again, Theano is no longer actively developed).
V Gladkova
@valglad
I'll open an issue then
Aaron Meurer
@asmeurer
See also sympy/sympy#14747 abut the theano thing
Sudarshan Kamath
@sudz123
Hi, I wanted to know is it necessary to run the entire ./bin/test everytime one makes a change to a particular module? I had made a few changes to test_ode.py in solvers and when I ran the test only on test_ode.py I got no error, however the complete test fails.
Kalevi Suominen
@jksuom
A change in a single module may affect tests in another module. It may sometimes be hard to discover those errors.
Sudarshan Kamath
@sudz123
All right, I'll keep that in mind, thanks
Ayushman Koul
@ayushmankoul

Hello @asmeurer @jksuom Sir I tried to debug the def _print_Symbol(self, expr): and def _deal_with_super_sub(self, string): methods in printing/latex.py file which could be the possible reasons of not enclosing symbol_latex variable in {} which is causing the assertion error as I indicated in my sympy/sympy#15117 unfortnately I am not able to fix this error.Apart from it I tried to alter the value of variable Psi_symbol to match the symbol_latex with indexed_latex but failed to do so.The following code is raising the assertion error

   def test_latex_indexed():
    Psi_symbol = Symbol('Psi_0', complex=True, real=False)
    Psi_indexed = IndexedBase(Symbol('Psi', complex=True, real=False))
    symbol_latex = latex(Psi_symbol * conjugate(Psi_symbol))
    indexed_latex = latex(Psi_indexed[0] * conjugate(Psi_indexed[0]))

Please help me to fix this issue.

Kalevi Suominen
@jksuom
I would replace the single assert symbol_latex.split() == ... with two separate lines assert symbol_latex == ... and assert indexed_latex == ... where the right hand sides are the results of the twolatexcalls.
Ayushman Koul
@ayushmankoul
Thank You @jksuom for helping me in solving this error.It has successfully passed all the test cases.Should I submit a new PR for it now or do I need to write new test for it ?
Kalevi Suominen
@jksuom
There is no need for a new PR. Only edit the code and the test.
Ayushman Koul
@ayushmankoul
I have created a new sympy/sympy#15151 for this issue and have altered the code to include very base in {}.Thank You @jksuom and @asmeurer for helping me in this.
Sudarshan Kamath
@sudz123
Hi, I have been continuously trying the ./bin/test and everytime it fails in the test_compilation.py and test_pickling.py. Also after the tests a new file is created called wrapper_module_20.pyx. I am running sympy on a MAC OS X with Python 3.6.3. My local repo is in sync with the upstream master. Should I file an Issure regarding this or can someone please help me out here? I can provide more details regarding the error if necessary.