Ticket #4091 (closed defect: fixed)
[with patche, positive review] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure
| Reported by: | mabshoff | Owned by: | craigcitro |
|---|---|---|---|
| Priority: | major | Milestone: | sage-3.1.2 |
| Component: | doctest coverage | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
******************************************
File "/home/john/sage-3.1.2.rc1/tmp/matrix_real_double_dense.py", line 493:
sage: b = e * v
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-3.1.2.rc1/local/lib/python2.5/doctest.py",
line 1228, in __run
compileflags, 1) in test.globs
File "<doctest __main__.example_8[8]>", line 1, in <module>
b = e * v###line 493:
sage: b = e * v
File "element.pyx", line 1384, in
sage.structure.element.RingElement.__mul__
(sage/structure/element.c:9357)
File "coerce.pyx", line 662, in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6364)
TypeError: unsupported operand parent(s) for '*': 'Complex Double
Field' and 'Vector space of degree 3 and dimension 1 over Real Double
Field
User basis matrix:
[0.440242867236 0.567868371314 0.695493875393]'
**********************************************************************
File "/home/john/sage-3.1.2.rc1/tmp/matrix_real_double_dense.py", line 494:
sage: diff = a.change_ring(CDF) - b
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-3.1.2.rc1/local/lib/python2.5/doctest.py",
line 1228, in __run
compileflags, 1) in test.globs
File "<doctest __main__.example_8[9]>", line 1, in <module>
diff = a.change_ring(CDF) - b###line 494:
sage: diff = a.change_ring(CDF) - b
NameError: name 'b' is not defined
**********************************************************************
File "/home/john/sage-3.1.2.rc1/tmp/matrix_real_double_dense.py", line 495:
sage: abs(abs(diff)) < 1e-10
Exception raised:
Traceback (most recent call last):
File "/home/john/sage-3.1.2.rc1/local/lib/python2.5/doctest.py",
line 1228, in __run
compileflags, 1) in test.globs
File "<doctest __main__.example_8[10]>", line 1, in <module>
abs(abs(diff)) < RealNumber('1e-10')###line 495:
sage: abs(abs(diff)) < 1e-10
TypeError: bad operand type for abs(): 'function'
**********************************************************************
Attachments
Change History
comment:2 Changed 5 years ago by jason
Never mind, it's probably just something to do with the new coercion stuff, just like it says.
comment:3 Changed 5 years ago by craigcitro
- Owner changed from mabshoff to craigcitro
- Status changed from new to assigned
- Summary changed from Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure to [with patch, needs review] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure
Actually, it wasn't coercion at all -- it was just as issue with linear algebra over inexact fields. Patch is attached. The issue had always been there, but it just became an issue since #3885 was fixed.
I'm just running a testall, I'll check out any errors in the morning.
comment:4 Changed 5 years ago by jason
- Summary changed from [with patch, needs review] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure to [with patch, positive review pending documentation note] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure
The patch fixes the errors in matrix/*.py[x] for me (ubuntu 8.04 32-bit). In looking at the code, it seems okay. However, something should be noted in the documentation that check only works if the ring is exact.
comment:5 Changed 5 years ago by craigcitro
- Summary changed from [with patch, positive review pending documentation note] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure to [with patches, positive review for first patch, second patch needs review] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure
Indeed, I should have added more documentation about this. I've added some documentation, and posted a second patch.
comment:6 Changed 5 years ago by mabshoff
- Summary changed from [with patches, positive review for first patch, second patch needs review] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure to [with patche, positive review] Sage 3.1.2.rc1: matrix_real_double_dense.py doctest failure
I am happy with the second patch. Any followup should be dealt with via a new ticket since this one is holding up 3.1.2.rc2 :)
Cheers,
Michael
comment:7 Changed 5 years ago by mabshoff
- Status changed from assigned to closed
- Resolution set to fixed
Merged in Sage 3.1.2.rc2
Changed 5 years ago by mabshoff
-
attachment
trac_4091_numerical_noise.patch
added
This patch fixes a couple noise issues

I wonder if that first bug has anything to do with #3058, which gives problems when dealing with things with custom bases.