#12977: Let singular_function expect "attributes" not as a dict
---------------------------------------+------------------------------------
       Reporter:  SimonKing            |         Owner:  malb        
           Type:  defect               |        Status:  needs_review
       Priority:  major                |     Milestone:  sage-5.1    
      Component:  commutative algebra  |    Resolution:              
       Keywords:                       |   Work issues:              
Report Upstream:  N/A                  |     Reviewers:  Mike Hansen 
        Authors:  Simon King           |     Merged in:              
   Dependencies:                       |      Stopgaps:              
---------------------------------------+------------------------------------
Changes (by {'newvalue': u'Simon King', 'oldvalue': ''}):

  * reviewer:  => Mike Hansen
  * author:  => Simon King


Old description:

> Here is how attributes are passed to libsingular when calling a singular
> function:
> {{{
> sage: from sage.libs.singular import singular_function
> sage: P.<x,y>=QQ[]
> sage: J = P*[P.random_element() for _ in range(100)]
> sage: NF = singular_function('reduce')
> sage: _ = NF(J.groebner_basis(),J,attributes={J:{'isSB':1}})
> }}}
>
> Hence, a dictionary is expected, where the keys are arguments to the
> function. Now, that's bad: The hash of ideals is broken and is slow (see
> #12976).
>
> Moreover, the attribute is supposed to be applied to a particular object,
> but ''not'' to an object that is only ''equal'' (but not identical).
>
> '''__Suggestion__'''
>
> Make it so that
> {{{
> sage: _ = NF(J.groebner_basis(),J,attributes=(None,{'isSB':1}))
> }}}
> works: attributes is a tuple or list of things that are to be interpreted
> as attribute of the different arguments of the singular function, in the
> given order.

New description:

 Here is how attributes are passed to libsingular when calling a singular
 function:
 {{{
 sage: from sage.libs.singular import singular_function
 sage: P.<x,y>=QQ[]
 sage: J = P*[P.random_element() for _ in range(100)]
 sage: NF = singular_function('reduce')
 sage: _ = NF(J.groebner_basis(),J,attributes={J:{'isSB':1}})
 }}}

 Hence, a dictionary is expected, where the keys are arguments to the
 function. Now, that's bad: The hash of ideals is broken and is slow (see
 #12976).

 Moreover, the attribute is supposed to be applied to a particular object,
 but ''not'' to an object that is only ''equal'' (but not identical).

 '''__Suggestion__'''

 Make it so that
 {{{
 sage: _ = NF(J.groebner_basis(),J,attributes=(None,{'isSB':1}))
 }}}
 works: attributes is a tuple or list of things that are to be interpreted
 as attribute of the different arguments of the singular function, in the
 given order.

 Apply

 * [attachment:trac12977_singular_function_attributes.patch]
 * [attachment:trac_12977-fix_doctest.patch]

--

Comment:

 Simon, your patch looks good, but I had to make a change to the doctest to
 get it to pass.  Are you okay with this change?  If so, you can mark this
 as positive review.

 For the patchbot:

 Apply trac12977_singular_function_attributes.patch and
 trac_12977-fix_doctest.patch

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