Closed cbm755 closed 1 year ago
Oh perhaps I misunderstand dbg_no_array
as it seems nothing was making Arrays... This issue may not be valid
Simpler way to hit this:
>> t = sym(true)
>> w = [t t]
pydebug: make_matrix_or_array: making 2D Array...
pydebug: I am here with an array with shape (2, 1)
pydebug: make_matrix_or_array: making 2D Array...
pydebug: I am here with an array with shape (1, 2)
w = (sym) [[True True]] (1×2 matrix)
>> sympy(w)
ans = ImmutableDenseNDimArray(Tuple(true, true), Tuple(Integer(1), Integer(2)))
>> isequal(w, w)
error: cell2mat: C must be a cell array
error: called from
cell2mat at line 47 column 7
uniop_bool_helper at line 62 column 11
isnan at line 51 column 5
isequal at line 62 column 3
>> isequal(t, t)
ans = 1
In uniop_bool_helper:
'if x is not None and x.is_Matrix:'
' # bool will map None to False'
' return [bool(sf(a, *pp)) for a in x.T],'
Maybe this should be if x is not None and isinstance(A, (MatrixBase, NDimArray)):
.
Or maybe just if isinstance(A, (MatrixBase, NDimArray):
. I remember some subtly about is_Matrix
versus isinstance()
but maybe it was just this explicit None handling...
This function also uses linear indexing, similar to #1222.
------- Original Message ------- On Friday, September 2nd, 2022 at 5:03 PM, Colin B. Macdonald @.***> wrote:
Simpler way to hit this:
>> t = sym(true) >> w = [t t] pydebug: make_matrix_or_array: making 2D Array... pydebug: I am here with an array with shape (2, 1) pydebug: make_matrix_or_array: making 2D Array... pydebug: I am here with an array with shape (1, 2) w = (sym) [[True True]] (1×2 matrix) >> sympy(w) ans = ImmutableDenseNDimArray(Tuple(true, true), Tuple(Integer(1), Integer(2))) >> isequal(w, w) error: cell2mat: C must be a cell array error: called from cell2mat at line 47 column 7 uniop_bool_helper at line 62 column 11 isnan at line 51 column 5 isequal at line 62 column 3
Interestingly, this error only occurs when we are using non-Pythonic IPC. To reproduce this error, one has to disable Pythonic IPC.
>> isequal(t, t) ans = 1
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
------- Original Message ------- On Friday, September 2nd, 2022 at 5:03 PM, Colin B. Macdonald @.***> wrote:
Simpler way to hit this:
>> t = sym(true) >> w = [t t] pydebug: make_matrix_or_array: making 2D Array... pydebug: I am here with an array with shape (2, 1) pydebug: make_matrix_or_array: making 2D Array... pydebug: I am here with an array with shape (1, 2) w = (sym) [[True True]] (1×2 matrix) >> sympy(w) ans = ImmutableDenseNDimArray(Tuple(true, true), Tuple(Integer(1), Integer(2))) >> isequal(w, w) error: cell2mat: C must be a cell array error: called from cell2mat at line 47 column 7 uniop_bool_helper at line 62 column 11 isnan at line 51 column 5 isequal at line 62 column 3
Interesting, this error only occurs when we are using non-Pythonic IPC. To reproduce this error, one has to disable Pythonic IPC.
>> isequal(t, t) ans = 1
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
This is based on a test from
@sym/and
, on the Array_not_Matrix branch:Note:
Looks like even after #1216, we're still getting Matrix from concatenate ops: