#6506: [with patch, needs work] further numpy type conversions
-----------------------+----------------------------------------------------
Reporter: robertwb | Owner: jkantor
Type: defect | Status: new
Priority: major | Milestone: sage-4.1.1
Component: numerical | Keywords:
Reviewer: | Author:
Merged: |
-----------------------+----------------------------------------------------
Comment(by jason):
I posted a patch which fixes lots of the documentation errors on #5081.
There are still some problems.
* printing issues, presumably because of the work from the patch on this
ticket on the precision code. It appears there is one less zero printed
in numbers.
{{{
$ sage -t complex_number.pyx
sage -t "devel/sage-main/sage/rings/complex_number.pyx"
**********************************************************************
File "/home/grout/sage/devel/sage-main/sage/rings/complex_number.pyx",
line 1917:
sage: ComplexNumber(1.000000000000000000000000000,2)
Expected:
1.000000000000000000000000000 + 2.000000000000000000000000000*I
Got:
1.00000000000000000000000000 + 2.00000000000000000000000000*I
**********************************************************************
File "/home/grout/sage/devel/sage-main/sage/rings/complex_number.pyx",
line 1919:
sage: ComplexNumber(1,2.000000000000000000000)
Expected:
1.000000000000000000000 + 2.000000000000000000000*I
Got:
1.00000000000000000000 + 2.00000000000000000000*I
**********************************************************************
1 items had failures:
2 of 9 in __main__.example_74
***Test Failed*** 2 failures.
For whitespace errors, see the file
/home/grout/sage/tmp/.doctest_complex_number.py
[11.8 s]
exit code: 1024
----------------------------------------------------------------------
The following tests failed:
sage -t "devel/sage-main/sage/rings/complex_number.pyx"
Total time for all tests: 11.8 seconds
$ sage -t real_mpfr.pyx
sage -t "devel/sage-main/sage/rings/real_mpfr.pyx"
**********************************************************************
File "/home/grout/sage/devel/sage-main/sage/rings/real_mpfr.pyx", line
4299:
sage: RealNumber('1.0000000000000000000000000000000000')
Expected:
1.0000000000000000000000000000000000
Got:
1.000000000000000000000000000000000
**********************************************************************
1 items had failures:
1 of 9 in __main__.example_126
***Test Failed*** 1 failures.
For whitespace errors, see the file
/home/grout/sage/tmp/.doctest_real_mpfr.py
[15.1 s]
exit code: 1024
----------------------------------------------------------------------
The following tests failed:
sage -t "devel/sage-main/sage/rings/real_mpfr.pyx"
Total time for all tests: 15.1 seconds
}}}
* Another error pointed out on #5081 that is deeper than a printing
issue. There appears to be a bug in the code---the same variable is used
in a list comprehension as is used in an enclosing loop. I rewrote some
of the code to not use some numpy and string parsing, instead using python
zip and string join methods. However, there still seems to be an error.
Can someone more familiar with the code look at this? I think all of
these errors stem from the same problem.
{{{
$ sage -t rings/number_field/totallyreal_rel.py
sage -t "devel/sage-main/sage/rings/number_field/totallyreal_rel.py"
**********************************************************************
File "/home/grout/sage/devel/sage-
main/sage/rings/number_field/totallyreal_rel.py", line 156:
sage: T = sage.rings.number_field.totallyreal_rel.tr_data_rel(F, 2,
2000)
Exception raised:
Traceback (most recent call last):
File "/home/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_3[3]>", line 1, in <module>
T = sage.rings.number_field.totallyreal_rel.tr_data_rel(F,
Integer(2), Integer(2000))###line 156:
sage: T = sage.rings.number_field.totallyreal_rel.tr_data_rel(F, 2,
2000)
File "/home/grout/sage/local/lib/python/site-
packages/sage/rings/number_field/totallyreal_rel.py", line 200, in
__init__
anm1s[i] +=
sum([m*Z_Fbasis[i]*adj[i].__int__()//adj[self.d].__int__() for i in
range(self.d)])
IndexError: list index out of range
**********************************************************************
File "/home/grout/sage/devel/sage-
main/sage/rings/number_field/totallyreal_rel.py", line 568:
sage: enumerate_totallyreal_fields_rel(F, 2, 2000)
Exception raised:
Traceback (most recent call last):
File "/home/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_5[4]>", line 1, in <module>
enumerate_totallyreal_fields_rel(F, Integer(2),
Integer(2000))###line 568:
sage: enumerate_totallyreal_fields_rel(F, 2, 2000)
File "/home/grout/sage/local/lib/python/site-
packages/sage/rings/number_field/totallyreal_rel.py", line 646, in
enumerate_totallyreal_fields_rel
T = tr_data_rel(F,m,B,a)
File "/home/grout/sage/local/lib/python/site-
packages/sage/rings/number_field/totallyreal_rel.py", line 200, in
__init__
anm1s[i] +=
sum([m*Z_Fbasis[i]*adj[i].__int__()//adj[self.d].__int__() for i in
range(self.d)])
IndexError: list index out of range
**********************************************************************
File "/home/grout/sage/devel/sage-
main/sage/rings/number_field/totallyreal_rel.py", line 577:
sage: ls = enumerate_totallyreal_fields_rel(F, 2, 10^4)
Exception raised:
Traceback (most recent call last):
File "/home/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_5[6]>", line 1, in <module>
ls = enumerate_totallyreal_fields_rel(F, Integer(2),
Integer(10)**Integer(4))###line 577:
sage: ls = enumerate_totallyreal_fields_rel(F, 2, 10^4)
File "/home/grout/sage/local/lib/python/site-
packages/sage/rings/number_field/totallyreal_rel.py", line 646, in
enumerate_totallyreal_fields_rel
T = tr_data_rel(F,m,B,a)
File "/home/grout/sage/local/lib/python/site-
packages/sage/rings/number_field/totallyreal_rel.py", line 200, in
__init__
anm1s[i] +=
sum([m*Z_Fbasis[i]*adj[i].__int__()//adj[self.d].__int__() for i in
range(self.d)])
IndexError: list index out of range
**********************************************************************
File "/home/grout/sage/devel/sage-
main/sage/rings/number_field/totallyreal_rel.py", line 578:
sage: print "ignore this"; ls # random (the second factor is
platform-dependent)
Exception raised:
Traceback (most recent call last):
File "/home/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_5[7]>", line 1, in <module>
print "ignore this"; ls # random (the second factor is platform-
dependent)###line 578:
sage: print "ignore this"; ls # random (the second factor is
platform-dependent)
NameError: name 'ls' is not defined
**********************************************************************
File "/home/grout/sage/devel/sage-
main/sage/rings/number_field/totallyreal_rel.py", line 600:
sage: [ f[0] for f in ls ]
Exception raised:
Traceback (most recent call last):
File "/home/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_5[8]>", line 1, in <module>
[ f[Integer(0)] for f in ls ]###line 600:
sage: [ f[0] for f in ls ]
NameError: name 'ls' is not defined
**********************************************************************
File "/home/grout/sage/devel/sage-
main/sage/rings/number_field/totallyreal_rel.py", line 603:
sage: [NumberField(ZZx(x[1]), 't').is_galois() for x in ls]
Exception raised:
Traceback (most recent call last):
File "/home/grout/sage/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/grout/sage/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/grout/sage/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_5[9]>", line 1, in <module>
[NumberField(ZZx(x[Integer(1)]), 't').is_galois() for x in
ls]###line 603:
sage: [NumberField(ZZx(x[1]), 't').is_galois() for x in ls]
NameError: name 'ls' is not defined
**********************************************************************
2 items had failures:
1 of 4 in __main__.example_3
5 of 12 in __main__.example_5
***Test Failed*** 6 failures.
For whitespace errors, see the file
/home/grout/sage/tmp/.doctest_totallyreal_rel.py
[4.3 s]
exit code: 1024
----------------------------------------------------------------------
The following tests failed:
sage -t "devel/sage-
main/sage/rings/number_field/totallyreal_rel.py"
Total time for all tests: 4.3 seconds
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6506#comment:3>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---