Updates:
Status: Started
Cc: ondrej.certik
Labels: Solvers
Comment #9 on issue 1646 by asmeurer: Solving inequalities
http://code.google.com/p/sympy/issues/detail?id=1646
OK. Because of issue 1641, the doctest runner does not work when run
as ./setup.py test or even with
./bin/doctest. The workaround is to do it on the individual files, as
in ./bin/doctest sympy/core/interval.py .
When you do this, the first thing you will see is "inconsistent leading
whitespace". This is also a bug (see the
same issue), but the workaround is to just add a newline at line 430 (the
end of the docstring). If you do this and
run it again, you will see a bunch of "NameError: name 'Interval' is not
defined" errors. This is because
everything in a doctest must be imported. In most cases, you just need to
do ">>> from SymPy import *".
I just noticed that there is an mpmath interval class called mpi that
handles intervals for arbitrary precision
mpmath floating point numbers. See sympy/mpmath/mptypes.py and
sympy/mpmath/libmpi.py . Note that it
does different things for the operators. This doesn't mean that you have
been duplicating code, because that is
specifically for floating point numbers and your class is more general.
However, you can look at it and at the
tests for it to see what kinds of things you can do. Also, maybe you could
include a way to evalf an interval into
an mpi in sympy/core/evalf.py.
You need to have tests for the actual interval class. The mpi tests in
sympy/mpmath/tests/test_interval.py
should give you some ideas. Also, I would make a test out of each of my
examples in the above comments,
especially the ones that you fixed.
Also, you should fix up the commit log to be more descriptive. Just do git
rebase -i master and mark the
commits as edit, then follow the instructions (how familiar are you with
git?).
The code itself is very nice. My only comment on it is that it would be
nice to have an operator do intersection.
Maybe / or //. I don't know if you were planning on implementing more in
the interval class, but I think that,
after fixing the above, I would give it a +1 where it stands now. Let's
see what Ondrej thinks about it though.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---