Skip to content

Commit

Permalink
Modify display for Array.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Sep 25, 2023
1 parent 979ce71 commit 0d99093
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions matlab/src/cpp/arrow/matlab/array/proxy/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ namespace arrow::matlab::array::proxy {
arrow::PrettyPrintOptions options;
options.window = 3;
options.skip_new_lines = true;
options.include_braces = false;
options.delimiter = " ";
options.include_braces = true;
options.delimiter = ", ";
// MATLAB array display uses 5 spaces between elements.
MATLAB_ERROR_IF_NOT_OK_WITH_CONTEXT(arrow::PrettyPrint(*array, options, &strs), context, error::ARRAY_DISPLAY_FAILED);
const auto str_utf8 = strs.str();
Expand Down
7 changes: 6 additions & 1 deletion matlab/src/matlab/+arrow/+array/Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@
end

methods (Access=protected)

function displayScalarObject(obj)
disp(obj.toString());
className = matlab.mixin.CustomDisplay.getClassNameForHeader(obj);
indent = " ";
disp("Arrow " + className + " with <strong>"+ obj.Length + "</strong> elements:")
disp(newline + indent + obj.toString() + newline);
end

end

methods
Expand Down

0 comments on commit 0d99093

Please sign in to comment.