Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vertcat: does not show error message for incompatible columns #1238

Open
cbm755 opened this issue Sep 13, 2022 · 4 comments
Open

vertcat: does not show error message for incompatible columns #1238

cbm755 opened this issue Sep 13, 2022 · 4 comments
Labels

Comments

@cbm755
Copy link
Collaborator

cbm755 commented Sep 13, 2022

In Array_and_Matrix branch:

%!error
%! z03 = sym (zeros (0, 3));
%! z04 = sym (zeros (0, 4));
%! [z03; z04]

This test passes. It is an error. But the error message is not shown:

octave:43> [z03; z04]
pydebug: vertcat: all inputs must have the same number of columns
error: sym/vertcat method failed
error: called from
    pycall_sympy__ at line 179 column 7
    vertcat at line 67 column 5

The thing shown in pydebug should be the error message---here just hacked to show up:

          'ncols = [number_of_columns(x) for x in args]'
          'if not all_equal(*ncols):'
          '    msg = "vertcat: all inputs must have the same number of columns"'
+        '    dbout(msg)'
          '    raise ShapeError(msg)'
          'CCC = [as_list_of_list(x) for x in args]'
          'CC = flatten(CCC, levels=1)'
@cbm755
Copy link
Collaborator Author

cbm755 commented Sep 13, 2022

Hmmm, it does give the error when run as vertcat(z03, z04) but not as [z03; z04]. Sounds like "Someone Else's Problem" (upstream). I'll add this zero case to the existing tests for vertcat error message

@cbm755 cbm755 closed this as completed Sep 13, 2022
@alexvong243f
Copy link
Collaborator

Should we file a bug upstream? Does octave behave this way because of compat?

@cbm755
Copy link
Collaborator Author

cbm755 commented Sep 15, 2022

I didn't dig any deeper. Do you mean "compatibility with Matlab"? I don't know, have not tried it in Matlab.

You can certainly file upsteam if you'd like.

@alexvong243f
Copy link
Collaborator

alexvong243f commented Sep 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants