python-2.7 status

15 views
Skip to first unread message

Francois Bissey

unread,
Oct 30, 2011, 9:34:47 PM10/30/11
to sage-devel
Hi all,

After the merging of #10903 and #11339 I cannot see
any doctest crashing anymore because of singular.

There are only about a handfull of files in which we have failling doctests
from python-2.7.

Here they are:
sage -t -long -force_lib "devel/sage-
main/sage/rings/padics/padic_capped_relative_element.pyx"
**********************************************************************
File "/usr/share/sage/devel/sage-
main/sage/rings/padics/padic_capped_relative_element.pyx", line 2339:
sage: hash(R(-1))
Expected:
95367431640624
Got:
1977800240
**********************************************************************

sage -t -long -force_lib "devel/sage-main/sage/rings/integer.pyx"
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/rings/integer.pyx", line 3046:
sage: n = -920390823904823094890238490238484; n.__hash__()
Expected:
6874330978542788722
Got:
-2623069716
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/rings/integer.pyx", line 3061:
sage: hash(n)
Expected:
-9223372036854767616
Got:
8192
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/rings/integer.pyx", line 3064:
sage: hash(n) == hash(int(n))
Expected:
True
Got:
False
**********************************************************************

sage -t -long -force_lib "devel/sage-
main/sage/combinat/words/nfactor_enumerable_word.py"
**********************************************************************
File "/usr/share/sage/devel/sage-
main/sage/combinat/words/nfactor_enumerable_word.py", line 20:
sage: it.next()
Expected:
word: 6456
Got:
word: 5645
**********************************************************************
File "/usr/share/sage/devel/sage-
main/sage/combinat/words/nfactor_enumerable_word.py", line 22:
sage: it.next()
Expected:
word: 5645
Got:
word: 6456
**********************************************************************

The first two indicate that something has changed in the hashing of integers
I think and needs to be dealt with. Anyone knows anything about that?
The last one seem to be a trivial change in the order of some permutations.
It should be looked at but seems minor.

While I haven't put up a python-2.7.2 spkg yet going from 2.7.1 to 2.7.2
introduces a few changes in the case of some messages:
2.7.1:
AssertionError: False is not True
2.7.2:
AssertionError: False is not true

I also got the following new doctest failure:
sage -t -long -force_lib "devel/sage-main/sage/matrix/matrix_double_dense.pyx"
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/matrix/matrix_double_dense.pyx",
line 1046:
sage: A.singular_values(eps='junk')
Expected:
Traceback (most recent call last):
...
ValueError: invalid literal for float(): junk
Got:
Traceback (most recent call last):
File "/usr/bin/ncadoctest.py", line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/usr/bin/sagedoctest.py", line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/usr/bin/ncadoctest.py", line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_19[37]>", line 1, in <module>
A.singular_values(eps='junk')###line 1046:
sage: A.singular_values(eps='junk')
File "matrix_double_dense.pyx", line 1075, in
sage.matrix.matrix_double_dense.Matrix_double_dense.singular_values
(sage/matrix/matrix_double_dense.c:6338)
File "parent.pyx", line 988, in sage.structure.parent.Parent.__call__
(sage/structure/parent.c:7326)
File "coerce_maps.pyx", line 82, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3268)
File "coerce_maps.pyx", line 77, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
(sage/structure/coerce_maps.c:3171)
File "real_double.pyx", line 548, in
sage.rings.real_double.RealDoubleElement.__init__
(sage/rings/real_double.c:5567)
ValueError: could not convert string to float: junk


I am unsure whether the following is a python-2.7 issue with rounding
or something else:
File "/usr/share/sage/devel/sage-main/sage/matrix/matrix_double_dense.pyx",
line 1771:
sage: x = A.solve_left(b); x.zero_at(1e-18) # fix noisy zeroes
Expected:
(0.666666666..., 0.0, 0.333333333...)
Got:
(0.666666666667, 7.50150692314e-18, 0.333333333333)
**********************************************************************
File "/usr/share/sage/devel/sage-main/sage/matrix/matrix_double_dense.pyx",
line 2468:
sage: B.is_hermitian(algorithm='naive', tol=1.0e-17)
Expected:
False
Got:
True

Patches are welcome in #9958.

Francois

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.

Reply all
Reply to author
Forward
0 new messages