If you want to help with this goal, just checkout my a_removal branch:
git pull http://fseoane.net/git/sympy.git a_removal
and submit fixes to me.
Most important issue right now is that the pretty printing system is
broken (but should not depend on the assumption system). For example:
In [5]: x*y
Out[5]:
1 ___ 1 ___
\/ x *\/ y
Thanks,
fabian
I think a more pressing issue is that core tests don't run:
$ bin/test sympy/core/
============================= test process starts ==============================
executable: /usr/bin/python (2.6.2-final-0)
sympy/core/tests/test_arit.py[42] ..F.F^CffF.FF.F.^C interrupted by user
________________________________________________________________________________
___________________ sympy/core/tests/test_arit.py:test_arit0 ___________________
File "/home/ondrej/repos/sympy/sympy/core/tests/test_arit.py", line
48, in test_arit0
assert e == Rational(0)
AssertionError
________________________________________________________________________________
____________________ sympy/core/tests/test_arit.py:test_pow ____________________
File "/home/ondrej/repos/sympy/sympy/core/tests/test_arit.py", line
93, in test_pow
assert e == Rational(0)
AssertionError
________________________________________________________________________________
_______________ sympy/core/tests/test_arit.py:test_pow_issue417 ________________
File "/home/ondrej/repos/sympy/sympy/core/tests/test_arit.py", line
158, in test_pow_issue417
assert 4**Rational(1, 4) == 2**Rational(1, 2)
AssertionError
________________________________________________________________________________
__________________ sympy/core/tests/test_arit.py:test_expand ___________________
File "/home/ondrej/repos/sympy/sympy/core/tests/test_arit.py", line
168, in test_expand
assert (e.expand()-a*c-b*c) == Rational(0)
AssertionError
________________________________________________________________________________
_______________ sympy/core/tests/test_arit.py:test_power_expand ________________
File "/home/ondrej/repos/sympy/sympy/core/tests/test_arit.py", line
210, in test_power_expand
assert p.expand() == a**2 + b**2 + 2*a*b
AssertionError
________________________________________________________________________________
___________________ sympy/core/tests/test_arit.py:test_ncmul ___________________
File "/home/ondrej/repos/sympy/sympy/core/tests/test_arit.py", line
235, in test_ncmul
assert (C*(A+B)).expand() == C*A+C*B
AssertionError
======== tests finished: 6 passed, 6 failed, 2 xfailed in 29.98 seconds ========
DO *NOT* COMMIT!
I had to kill it with ctrl-C. Besides that, there seem to be some
basic problems with comparisons:
In [1]: 4**Rational(1, 4)
Out[1]:
⎽⎽⎽
╲╱ 2
In [2]: 2**Rational(1, 1)
Out[2]: 2
In [3]: 2**Rational(1, 2)
Out[3]:
⎽⎽⎽
╲╱ 2
In [4]: 4**Rational(1, 4) == 2**Rational(1, 2)
Out[4]: False
So I would concentrate on this. Pretty printing is a small cosmetic issue.
Ondrej
Any progress on this one? Let us know your plans with the assumptions,
as Mateusz is coming today to Reno, so we can work on that too. It is
the most pressing thing in sympy now to be fixed.
Ondrej
I've started going through the tests and trying to fix them one at a
time, but it's extremely slow going, mostly because I don't know what
I'm doing. I can't find any real documentation on the assumptions
system, and I don't know what the "old" and "new" systems are beyond a
few pieces that I've been able to put together.
I get the impression that this is fairly important, and I'd like to help
with it, but I need some guidance. Documentation would be good, but if
that doesn't exist then we're going to need to another plan.
Also, it looks like Fabian's SymPy repository has been taken down. That
combined with his lack of responses here is a bit worrying. Not wanting
to jump to any conclusions, but if Fabian is unable to continue this
work (and I understand if that's the case), I hope we have what we need
to finish it.
Any suggestions on how to proceed?
-Kevin
I think Fabian is busy with school. We should finish it ourselves.
>
> Any suggestions on how to proceed?
Essentially, the old system are assumptions attached to each Symbol()
instances, while the new system are assumptions attached in the
Assumption() instance, and that instance is then passed around into
methods like refine(). So it works just like in mathematica.
http://reference.wolfram.com/mathematica/ref/Refine.html
So what has to be done is:
* polish Fabian's branch, so that all tests pass (if you can't access
it, let me know, I should have it checked out somewhere)
* remove assumptions from the core system, and use refine() and the
new assumptions system
Then we can finally start refactoring the core, as it will become simpler.
Indeed this is an important task. Thanks a lot for looking into it.
Let me know if you have any questions -- If you have time to work on
this, I will reserve some time every day to help you out. if there are
at least 2 people working on it, we'll be able to finish it.
Ondrej
I pushed Fabian's latest patches into the "a_removal" branch here:
git://github.com/certik/sympy.git
Ondrej
I suggest to first get all the tests pass, so that the branch is
usable. And then simply work file by file and removing the old
assumptions stuff and make sure all the tests pass.
>
> Is this just a matter or replacing .is_real type assumptions with ask
> (x, Q.Real), or are there bugs that need working out?
I think it's just this.
Ondrej
No, I think it's more complicated than that and that a significant
amount of nontrivial work is needed. For example, in a_removal (282bb5),
Or(Assume(x, 'a'), Assume(x, 'b')) raises (that's the first failure in
bin/test) because Or sorts its arguments. In master, this works thanks
to the following bit of nonsense:
(Assume(x, 'b') - Assume(x, 'a')).is_negative == False
I don't know what is the best way to proceed but I think that attempting
to solve the problem by directly removing the old assumptions will fail.
IMHO, the only way is to refactor the core and the logic modules first.
Ronan
I think the only way to proceed is to take Fabian's work, and make it
usable, so that all tests pass. That's the very first step, unless we
have this starting point, we can't get nowhere. After that, we should
just remove stuff that can be removed and replace it with the new
assumptions system. If something has to be refactored, then it should
be refactored on the way.
Ondrej
OK, but which work and which tests? I thought that everything he did,
except trying to remove the old assumptions, was already in and passed
all current tests.
Ronan
His work in the "a_removal" branch that I pushed also to my github,
and the tests that fail, as I reported in the email in this thread
above --- my very first email:
http://groups.google.com/group/sympy/msg/c7d029939f453f17
Ondrej
It seems like some evaluation bug. Try to debug it how the expression
is constructed. Also, for clarity, I would discourage to use global
assumptions in tests. Just use refine() for simplifying (with taking
assumptions into account).
Ondrej
In master this is no longer a problem, since it doesn't rely on the
cached instances anymore (this allows certain other things to work
properly, like Integer("0")). Rebasing a_removal onto master (which is
something I've already done in my own repro, and could push somewhere if
it will help) should fix this problem, I think.
-Kevin
Not if it just "hey, can you verify that it does this weird thing on your machine too". But now I am off until the end of January, so I can do real work too. :)
Aaron Meurer
>
> Vinzent
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
I am glad there is interest in this. I've been busy lately moving to Paris,
but now I am settled so I'll get some time to work on this.
If anyone has patches on this, please give me your git repo and I'll review
& merge. Other, the place for discussion is task 1047
(http://code.google.com/p/sympy/issues/detail?id=1047), I'll try to answer
all questions that arise and post my progress there.
> --
>
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+un...@googlegroups.com.
> For more options, visit this group at
I would say that directly swapping out the old assumption system for the
new has failed, and that we therefore need to duplicate with the new one
everything the old one does.
> I am glad there is interest in this. I've been busy lately moving to Paris,
> but now I am settled so I'll get some time to work on this.
With the holiday season, I won't be able to do much in the next 2 weeks.
I'll be in Paris next week (if I don't freeze to death while attempting
to cross the Channel), maybe some face-to-face discussion could be
useful?
Ronan
Yes, you should definitely meet and work together. It's very effective.
Ondrej