#10275: matrix output strangeness for cached methods
-------------------------------------------+--------------------------------
   Reporter:  jhpalmieri                   |          Owner:  jason, was        
         
       Type:  defect                       |         Status:  positive_review   
         
   Priority:  minor                        |      Milestone:  sage-4.7.3        
         
  Component:  linear algebra               |       Keywords:                    
         
Work_issues:                               |       Upstream:  N/A               
         
   Reviewer:  Julian Rueth, John Palmieri  |         Author:  John Palmieri, 
Julian Rueth
     Merged:                               |   Dependencies:                    
         
-------------------------------------------+--------------------------------
Changes (by newvalueoldvalue):

  * status:  needs_review => positive_review
  * reviewer:  Julian Rueth => Julian Rueth, John Palmieri
  * author:  John Palmieri => John Palmieri, Julian Rueth


Old description:

> From [http://groups.google.com/group/sage-
> devel/browse_thread/thread/60ce4391e54e74be?tvc=2 sage-devel]: Something
> is not quite right in the cleverness used to output matrices:
> {{{
> sage: M
> 76 x 58 dense matrix over Integer Ring (type 'print M.str()' to see all
> of the entries)
> sage: M.hermite_form()
> 76 x 58 dense matrix over Integer Ring (type 'print hnf-True-False.str()'
> to see all of the entries)
> }}}
> This issue arises with methods which cache their results (like
> hermite_form), whereas other methods (like transpose) work the way
> they're supposed to.  The proposed fix:
>
>  - in the function {{{sage_variablename}}} which tries to get the name of
> an object, only return strings which are valid identifiers for Python
> objects.
>
>  - then in the caching methods for matrices, make sure the keys are not
> valid identifiers by appending a symbol like "$".
>
> ----
>
> Apply [attachment:trac_10275_doctest.patch] to the sage repository.

New description:

 From [http://groups.google.com/group/sage-
 devel/browse_thread/thread/60ce4391e54e74be?tvc=2 sage-devel]: Something
 is not quite right in the cleverness used to output matrices:
 {{{
 sage: M
 76 x 58 dense matrix over Integer Ring (type 'print M.str()' to see all of
 the entries)
 sage: M.hermite_form()
 76 x 58 dense matrix over Integer Ring (type 'print hnf-True-False.str()'
 to see all of the entries)
 }}}
 This issue arises with methods which cache their results (like
 hermite_form), whereas other methods (like transpose) work the way they're
 supposed to.  The proposed fix:

  - in the function {{{sage_variablename}}} which tries to get the name of
 an object, only return strings which are valid identifiers for Python
 objects.

  - then in the caching methods for matrices, make sure the keys are not
 valid identifiers by appending a symbol like "$".

 ----

 Apply [attachment:trac_10275-fixed.patch] to the sage repository.

--

Comment:

 Your patch has "sage: sage: " on line 1498.  I'm attaching a new version.

 I agree that the problem seems to have been fixed by #10903.  Doctests
 pass, so positive review.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10275#comment:7>
Sage <http://www.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.

Reply via email to