#4812: [with patch, needs work] matrix_plot is broken for matrices with
"complicated" base rings
----------------------+-----------------------------------------------------
 Reporter:  mhansen   |        Owner:  was     
     Type:  defect    |       Status:  new     
 Priority:  major     |    Milestone:  sage-3.4
Component:  graphics  |   Resolution:          
 Keywords:            |  
----------------------+-----------------------------------------------------
Changes (by mabshoff):

  * summary:  [with patch, positive review] matrix_plot is broken for
              matrices with "complicated" base rings => [with
              patch, needs work] matrix_plot is broken for
              matrices with "complicated" base rings
  * milestone:  sage-3.2.2 => sage-3.4

Comment:

 This patch needs some fixing:
 {{{
 sage -t -long "devel/sage/sage/plot/matrix_plot.py"
 **********************************************************************
 File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/devel/sage/sage/plot/matrix_plot.py", line 129:
     sage: matrix_plot(random_matrix(P, 3, 3))
 Expected:
     Traceback (most recent call last):
     ...
     ValueError: can not convert array entries to floating point numbers
 Got:
     Traceback (most recent call last):
       File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/local/bin/ncadoctest.py", line 1231, in run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/local/bin/sagedoctest.py", line 38, in
 run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/local/bin/ncadoctest.py", line 1172, in
 run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_3[15]>", line 1, in <module>
         matrix_plot(random_matrix(P, Integer(3), Integer(3)))###line 129:
     sage: matrix_plot(random_matrix(P, 3, 3))
       File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/local/lib/python2.5/site-packages/sage/plot/misc.py",
 line 285, in wrapper
         return func(*args, **options)
       File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/local/lib/python2.5/site-
 packages/sage/plot/matrix_plot.py", line 150, in matrix_plot
         mat = mat.change_ring(RDF).numpy()
       File "matrix0.pyx", line 888, in
 sage.matrix.matrix0.Matrix.change_ring (sage/matrix/matrix0.c:5304)
       File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/local/lib/python2.5/site-
 packages/sage/matrix/matrix_space.py", line 354, in __call__
         return self.matrix(entries, copy=copy, coerce=coerce, rows=rows)
       File "/scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/local/lib/python2.5/site-
 packages/sage/matrix/matrix_space.py", line 979, in matrix
         return self.__matrix_class(self, entries=x, copy=copy,
 coerce=coerce)
       File "matrix_double_dense.pyx", line 222, in
 sage.matrix.matrix_double_dense.Matrix_double_dense.__init__
 (sage/matrix/matrix_double_dense.c:2203)
       File "polynomial_element.pyx", line 649, in
 sage.rings.polynomial.polynomial_element.Polynomial.__float__
 (sage/rings/polynomial/polynomial_element.c:7124)
     TypeError: cannot coerce nonconstant polynomial to float
 **********************************************************************
 1 items had failures:
    1 of  18 in __main__.example_3
 ***Test Failed*** 1 failures.
 For whitespace errors, see the file /scratch/mabshoff/release-
 cycle/sage-3.2.2.rc1/tmp/.doctest_matrix_plot.py
          [5.1 s]
 exit code: 1024
 }}}
 Dan: Please don't give positive reviews without at least doctesting all
 changed files ;)

 The fix here seems obvious since only the traceback message has changed.

 Cheers,

 Michael

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4812#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to