I figured out the problem. It's in evalf_symbol. 

def evalf_symbol(x, prec, options):
    val = options['subs'][x]

The x is the actual symbol and the numpy array provided is indexed by the 
string representation of the symbol.

Numpy can't index by a Symbol, ugh. 

In [23]: x = array([(1.1, 2.2), (3.3, 4.4), (5.5, 6.6)], 
dtype=[(Symbol('s0'), '<f8'), (Symbol('s1'), '<f8')])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-23-3b59912775d8> in <module>()
----> 1 x = array([(1.1, 2.2), (3.3, 4.4), (5.5, 6.6)], 
dtype=[(Symbol('s0'), '<f8'), (Symbol('s1'), '<f8')])

TypeError: data type not understood

Could the evalf_symbol be modified to try the string representation as a 
fallback position, i.e. the path of least surprise?

def evalf_symbol(x, prec, options):
    try:
        val = options['subs'][x]
    except IndexError:
        val = options['subs'][x.name]

If this is an acceptable change, could someone point me in the direction of 
how to submit properly (e.g. ticket/ patch procedure)?

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to