#11921: Allow Sympy conversion sign/sgn
-------------------------+--------------------------------------------------
   Reporter:  kcrisman   |          Owner:  burcin                    
       Type:  defect     |         Status:  needs_review              
   Priority:  major      |      Milestone:  sage-5.0                  
  Component:  symbolics  |       Keywords:  sympy conversion beginner 
Work_issues:             |       Upstream:  N/A                       
   Reviewer:             |         Author:  Peter Story, Burcin Erocal
     Merged:             |   Dependencies:                            
-------------------------+--------------------------------------------------
Changes (by burcin):

  * status:  needs_work => needs_review


Old description:

> From [http://groups.google.com/group/sage-support/t/592e98fcece39df1 this
> thread on sage-support]:
> {{{
> Hi,
> Sage uses a dictionary to translate Sage function names to SymPy ones
> when they are different.
> Signal function is called "sgn" in Sage and "sign" in Sympy but the
> respective translation is not in the dictionary, and a error is issued
> if one tries to do something like:
>    x = var('x'); sgn(x)._sympy_()
> To fix it, it is just a matter of adding
>                 "sgn": "sign",
> to the dictionary.
> Such dictionary is called "translation_table" and it is inside
> function "composition" from class "SympyConverter" of file "sage/
> symbolic/expression_conversions.py".
> I would like to know how can I submit a patch, or ask someone to do
> it, and if it is necessary to include something in a unit test (like I
> did for Sympy for the inverse translation).
> ?
> }}}

New description:

 From [http://groups.google.com/group/sage-support/t/592e98fcece39df1 this
 thread on sage-support]:
 {{{
 Hi,
 Sage uses a dictionary to translate Sage function names to SymPy ones
 when they are different.
 Signal function is called "sgn" in Sage and "sign" in Sympy but the
 respective translation is not in the dictionary, and a error is issued
 if one tries to do something like:
    x = var('x'); sgn(x)._sympy_()
 To fix it, it is just a matter of adding
                 "sgn": "sign",
 to the dictionary.
 Such dictionary is called "translation_table" and it is inside
 function "composition" from class "SympyConverter" of file "sage/
 symbolic/expression_conversions.py".
 I would like to know how can I submit a patch, or ask someone to do
 it, and if it is necessary to include something in a unit test (like I
 did for Sympy for the inverse translation).
 ?
 }}}

 Apply:
  * attachment:trac_11921-sympy_conversion.patch
  * attachment:trac_11921_conversionsDictionary.patch
  * attachment:trac_11921-doctest.patch

--

Comment:

 I attached a new patch that adds a doctest as well. This is ready for
 review now.

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