These are chat archives for symengine/symengine

22nd
Jan 2015
Ondřej Čertík
@certik
Jan 22 2015 18:35
Thanks for implementing the benchmarks @isuruf.
Ondřej Čertík
@certik
Jan 22 2015 18:55
@shivamvats, let me know if you need help with the PR #361.
Shivam Vats
@shivamvats
Jan 22 2015 19:03
I'm just confused by the unexpected behaviour of nosetests. py.test works fine.
Nosetests reports assertion error in testvar when run from csympy/csympy directory but works well when run from csympy/csympy/tests directory. Similarly, though the test function in `_init.pyis unrelated, removing it makes nosetests work fromcsympy/csympy` directory
Does importing pytest in the test function in __init__.py import it globally?
Ondřej Čertík
@certik
Jan 22 2015 19:10
I think it does
But it is only imported if you call test() from __init__.py, which you don't, do you?
Shivam Vats
@shivamvats
Jan 22 2015 19:11
No I don't.
Ondřej Čertík
@certik
Jan 22 2015 19:11
So pytest should not be imported then.
Ah, unless nosetests thinks that test is a test function with tests. But I thought nosetests and py.test only execute files of the form test_*.py
Try to rename test to something_else and see if it helps.
Shivam Vats
@shivamvats
Jan 22 2015 19:13
I don't think that is the issue as nostests is not failing with the raises tests in test_symbol
Ondřej Čertík
@certik
Jan 22 2015 19:17
@shivamvats I tested your PR and it works for me, both with py.test, nosetests and nosetests without py.test installed
Try to remove any .pyc files
I am suspecting that you might have pytest.pyc laying around.
Ah, sorry --- I didn't realize you didn't move pytest.py yet.
You need to move it, otherwise csympy.test() will not run.
Ondřej Čertík
@certik
Jan 22 2015 19:24
@shivamvats this should fix it: shivamvats/csympy#1
Shivam Vats
@shivamvats
Jan 22 2015 19:35
Well I have been getting these errors after moving raises to utilities too. Probably, it it a local issue
Ondřej Čertík
@certik
Jan 22 2015 19:36
Post steps how to reproduce your error and I can try on my computer.
Shivam Vats
@shivamvats
Jan 22 2015 19:40
My current working directory is in the same condition as will be my PR after merging your PR.
  1. Go to csympy/csympy
  2. Try py.test, should work. Now try nosetests. Should give an error in test_var
Shivam Vats
@shivamvats
Jan 22 2015 19:51
I think I have figured it out. Nosetests is running the test function in __init__.py too.
Ondřej Čertík
@certik
Jan 22 2015 19:51
I see
Shivam Vats
@shivamvats
Jan 22 2015 19:51
That makes it import pytest globally, which is causing all these problems.
Ondřej Čertík
@certik
Jan 22 2015 19:51
I run nosetests from the root directory
When I run it from the csympy subdirectory, I get the
======================================================================
ERROR: csympy.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/certik/bld/profile/xd2emat6tjxu/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/certik/repos/csympy/csympy/__init__.py", line 6, in test
    import pytest, os
ImportError: No module named pytest
Shivam Vats
@shivamvats
Jan 22 2015 19:53
That's interesting
Ondřej Čertík
@certik
Jan 22 2015 19:53
so things work. You should not run nosetests from the subdirectory.
Shivam Vats
@shivamvats
Jan 22 2015 19:54
The reason I run tests from csympy subdirectory is that I get errors on runnning py.test from root
Ondřej Čertík
@certik
Jan 22 2015 19:54
Post the error
Here is what I get:
certik@redhawk:~/repos/csympy(pr-361-fix)$ py.test
============================= test session starts ==============================
platform linux2 -- Python 2.7.8 -- py-1.4.20 -- pytest-2.5.2
collected 125 items 

csympy/tests/test_arit.py .............
csympy/tests/test_eval.py ..
csympy/tests/test_functions.py .......
csympy/tests/test_integer.py .....
csympy/tests/test_matrices.py ...............
csympy/tests/test_ntheory.py ...........................................
csympy/tests/test_subs.py ....
csympy/tests/test_symbol.py ..
csympy/tests/test_sympify.py ......
csympy/tests/test_sympy_conv.py .........................
csympy/tests/test_var.py ...

========================== 125 passed in 1.87 seconds ==========================
Ondřej Čertík
@certik
Jan 22 2015 19:57
Interesting. Where is the location of csympy_wrapper.so?
You have a little newer py.test, I wonder if they changed something.
Shivam Vats
@shivamvats
Jan 22 2015 19:59
I have it in csympy/csympy/lib
That's the default location, I guess.
Ondřej Čertík
@certik
Jan 22 2015 19:59
That's correct.
What's confusing is this: build/csympy/__init__.py
Are you using in-tree build, or out-of-tree build of csympy?
Shivam Vats
@shivamvats
Jan 22 2015 20:01
I build csympy in place.
Ondřej Čertík
@certik
Jan 22 2015 20:04
so why is it quoting the build directory?
There is no build directory when csympy is build in place.
Shivam Vats
@shivamvats
Jan 22 2015 20:10
There is indeed a build directory in my csympy directory. Is it possible that it got created when I made csympy from within its own subdirectory?
Ondřej Čertík
@certik
Jan 22 2015 20:15
What do you mean by "I made csympy from within its own subdirectory"?
Shivam Vats
@shivamvats
Jan 22 2015 20:16
You are absolutely right!
Probably the last time, I used the make command from csympy/csympy
Ondřej Čertík
@certik
Jan 22 2015 20:16
You can call make from any subdirectory
it will never create a build, if you do in-tree build.
Maybe you called cmake from a subdirectory?
Shivam Vats
@shivamvats
Jan 22 2015 20:17
It's possible. I
I've not been too strict about doing it from root
I've deleted the build directory and it's fine now!
Thank you :)
Ondřej Čertík
@certik
Jan 22 2015 20:18
Excellent, I am glad it works now.
Shivam Vats
@shivamvats
Jan 22 2015 20:22
I should have been more careful.
I was looking into last year's gsoc ideas and the one about series expansion seemed interesting. Are there any such issues you'd want me to work on?
Ondřej Čertík
@certik
Jan 22 2015 20:23
Yes, we definitely need to implement series expansion.
If you want to tackle it, we can discuss the details.
Shivam Vats
@shivamvats
Jan 22 2015 20:26
That's great! I've been looking into Sympy's implementation of the same to get an idea about the structure.
Are there any additions to the ideas list for this year?
Ondřej Čertík
@certik
Jan 22 2015 20:26
We are trying to figure out some good ideas. Are you interested in applying as a student?
Shivam Vats
@shivamvats
Jan 22 2015 20:27
Yes, I'd love to, if I can help.
This message was deleted
Shivam Vats
@shivamvats
Jan 22 2015 20:51
Thilina also told me you are interested in factorisation. Will you be accepting applications on topics outside of the current ideas list?
Ondřej Čertík
@certik
Jan 22 2015 21:29
Yes, definitely
Ondřej Čertík
@certik
Jan 22 2015 23:02
You can pick any idea that you like and apply. The best is to discuss it first though.