gnu-octave / symbolic

A Symbolic Package for Octave using SymPy
https://octave.sourceforge.io/symbolic/
GNU General Public License v3.0
151 stars 36 forks source link

Array_not_Matrix: uniop_bool_helper may not work with Array #1225

Open cbm755 opened 2 years ago

cbm755 commented 2 years ago

this code:

              'if x if not None and x.is_Matrix:'
              '    return x.applyfunc(sf, *pp)'

Will need fixes something like #1224 for the is_Matrix part. But its also possible the .applyfunc bit will need to go through @alexvong243f's make_matrix_or_array.

I should do some experiments in SymPy: what is supposed to happen if you start with a Matrix and then .applyfunc your way to non-Expr entries?

cbm755 commented 2 years ago

Related upstream question: https://github.com/sympy/sympy/issues/24008

cbm755 commented 2 years ago

Based on upstream comments, we should assume that .applyfunc would return a TypeError or similar if it produces something that cannot go back into a matrix.

I guess we catch that and try again with a loop and an Array? Might easiest to leave this until we can get that error from SymPy...