Skip to content

Commit

Permalink
apacheGH-38946: [MATLAB] Fix spelling (apache#38947)
Browse files Browse the repository at this point in the history
### Rationale for this change

### What changes are included in this PR?

Spelling fixes to matlab/

### Are these changes tested?

### Are there any user-facing changes?

* Closes: apache#38946

Lead-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Kevin Gurney <kevin.p.gurney@gmail.com>
Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
  • Loading branch information
2 people authored and dgreiss committed Feb 17, 2024
1 parent 49d6ea3 commit b8d9f0e
Show file tree
Hide file tree
Showing 33 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/array/proxy/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace arrow::matlab::array::proxy {
/*
* Display primitive and string types horizontally without
* opening and closing delimiters. Use " | " as the delimiter
* between elments. Below is an example Int32Array display:
* between elements. Below is an example Int32Array display:
*
* 1 | 2 | 3 | ... | 6 | 7 | 8
*/
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/array/proxy/time_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace arrow::matlab::array::proxy {
const std::u16string& time_unit_utf16 = time_unit_mda[0];
MATLAB_ASSIGN_OR_ERROR(const auto time_unit,
timeUnitFromString(time_unit_utf16),
error::UKNOWN_TIME_UNIT_ERROR_ID);
error::UNKNOWN_TIME_UNIT_ERROR_ID);

MATLAB_ERROR_IF_NOT_OK(validateTimeUnit<ArrowType>(time_unit),
error::INVALID_TIME_UNIT);
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace arrow::matlab::array::proxy {
const std::u16string& u16_timeunit = units_mda[0];
MATLAB_ASSIGN_OR_ERROR(const auto time_unit,
arrow::matlab::type::timeUnitFromString(u16_timeunit),
error::UKNOWN_TIME_UNIT_ERROR_ID)
error::UNKNOWN_TIME_UNIT_ERROR_ID)

// create the timestamp_type
auto data_type = arrow::timestamp(time_unit, timezone);
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/bit/pack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace arrow::matlab::bit {
}
}

// Pack an unpacked MATLAB logical array into into a bit-packed arrow::Buffer.
// Pack an unpacked MATLAB logical array into a bit-packed arrow::Buffer.
arrow::Result<std::shared_ptr<arrow::Buffer>> pack(const ::matlab::data::TypedArray<bool> matlab_logical_array) {
// Validate that the input arrow::Buffer has sufficient size to store a full bit-packed
// representation of the input MATLAB logical array.
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/error/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace arrow::matlab::error {
static const char* UNICODE_CONVERSION_ERROR_ID = "arrow:matlab:unicode:UnicodeConversion";
static const char* STRING_BUILDER_APPEND_FAILED = "arrow:matlab:array:string:StringBuilderAppendFailed";
static const char* STRING_BUILDER_FINISH_FAILED = "arrow:matlab:array:string:StringBuilderFinishFailed";
static const char* UKNOWN_TIME_UNIT_ERROR_ID = "arrow:matlab:UnknownTimeUnit";
static const char* UNKNOWN_TIME_UNIT_ERROR_ID = "arrow:matlab:UnknownTimeUnit";
static const char* INVALID_TIME_UNIT = "arrow:type:InvalidTimeUnit";
static const char* FIELD_FAILED_TO_CREATE_TYPE_PROXY = "arrow:field:FailedToCreateTypeProxy";
static const char* ARRAY_FAILED_TO_CREATE_TYPE_PROXY = "arrow:array:FailedToCreateTypeProxy";
Expand Down
4 changes: 2 additions & 2 deletions matlab/src/cpp/arrow/matlab/tabular/get_row_as_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ namespace arrow::matlab::tabular {
ARROW_RETURN_NOT_OK(arrow::PrettyPrint(*slice, opts, &ss));
} else if (type_id == arrow::Type::type::STRUCT) {
// Use <Struct> as a placeholder since we don't have a good
// way to display StructArray elements horiztonally on screen.
// way to display StructArray elements horizontally on screen.
ss << "<Struct>";
} else if (type_id == arrow::Type::type::LIST) {
// Use <List> as a placeholder since we don't have a good
// way to display ListArray elements horiztonally on screen.
// way to display ListArray elements horizontally on screen.
ss << "<List>";
} else {
return arrow::Status::NotImplemented("Datatype " + column->type()->ToString() + "is not currently supported for display.");
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/tabular/proxy/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace arrow::matlab::tabular::proxy {
std::vector<std::u16string> field_names_utf16;
field_names_utf16.reserve(num_fields);

// Conver the field names from UTF-8 to UTF-16.
// Convert the field names from UTF-8 to UTF-16.
for (const auto& field_name_utf8 : field_names_utf8) {
MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(const auto field_name_utf16, arrow::util::UTF8StringToUTF16(field_name_utf8), context, error::UNICODE_CONVERSION_ERROR_ID);
field_names_utf16.push_back(field_name_utf16);
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/type/proxy/time_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace arrow::matlab::type::proxy {
const std::u16string& time_unit_utf16 = time_unit_mda[0];
MATLAB_ASSIGN_OR_ERROR(const auto timeunit,
timeUnitFromString(time_unit_utf16),
error::UKNOWN_TIME_UNIT_ERROR_ID);
error::UNKNOWN_TIME_UNIT_ERROR_ID);

// validate timeunit
MATLAB_ERROR_IF_NOT_OK(validateTimeUnit<ArrowType>(timeunit),
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/type/proxy/timestamp_type.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace arrow::matlab::type::proxy {
const std::u16string& utf16_timeunit = timeunit_mda[0];
MATLAB_ASSIGN_OR_ERROR(const auto timeunit,
arrow::matlab::type::timeUnitFromString(utf16_timeunit),
error::UKNOWN_TIME_UNIT_ERROR_ID);
error::UNKNOWN_TIME_UNIT_ERROR_ID);

auto type = arrow::timestamp(timeunit, timezone);
auto time_type = std::static_pointer_cast<arrow::TimestampType>(type);
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+array/StructArray.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
end

function nullSubVal = get.NullSubstitutionValue(obj)
% Return a cell array containing each field's type-specifc
% Return a cell array containing each field's type-specific
% "null" value. For example, NaN is the type-specific null
% value for Float32Arrays and Float64Arrays
numFields = obj.NumFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
opts.FullClassName(1, 1) string
opts.ClassName(1, 1) string
% When displaying heterogeneous arrays, only the name of the
% closest shared anscestor class is displayed in bold. All other
% closest shared ancestor class is displayed in bold. All other
% class names are not bolded.
opts.BoldFont(1, 1) logical
end
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+internal/+validate/nonsparse.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%NONSPARESE Verifies data is nonsparse. Otherwise throws an error with the
% identifier "arrrow:array:Sparse".
% identifier "arrow:array:Sparse".

% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+internal/+validate/realnumeric.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%REALNUMERIC Verifies the numeric array data is real. Otherwise throws an
% error with the identifier "arrrow:array:ComplexNumeric".
% error with the identifier "arrow:array:ComplexNumeric".

% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+internal/+validate/shape.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%SHAPE Verifies data is either a vector or empty. Otherwise throws an error
% with the identifier "arrrow:array:InvalidShape".
% with the identifier "arrow:array:InvalidShape".

% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+internal/+validate/type.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%TYPE Verifies data has the expected class type. Otherwise throws an
% error with the identifier "arrrow:array:InvalidType".
% error with the identifier "arrow:array:InvalidType".

% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
dimnames = ["Row" "Variables"];

numvars = numel(varnames);
indicesToUniqify = [numvars + 1 numvars + 2];
indicesToUniquify = [numvars + 1 numvars + 2];

strs = matlab.lang.makeUniqueStrings([varnames dimnames], indicesToUniqify);
dimnames = strs(indicesToUniqify);
strs = matlab.lang.makeUniqueStrings([varnames dimnames], indicesToUniquify);
dimnames = strs(indicesToUniquify);
end

2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+type/Type.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
else
% Check if every type in the array has the same class type.
% If so, call getDisplayPropertyGroups() so that all
% properties assoicated with that class are displayed.
% properties associated with that class are displayed.
classnames = arrayfun(@(type) string(class(type)), obj);
if numel(unique(classnames)) == 1
groups = getDisplayPropertyGroups(obj(1));
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+util/table2mlarrow.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
% Takes a MATLAB table T and returns struct array equivalents
% which are suitable for passing to the mlarrow C++ MEX layer.
%
% VARIABLES is an 1xN struct array representing the the table variables.
% VARIABLES is an 1xN struct array representing the table variables.
%
% VARIABLES contains the following fields:
%
Expand Down
2 changes: 1 addition & 1 deletion matlab/test/arrow/array/list/tTableValidator.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function validateElementNestedTableVariable(testCase) %#ok<MANU>
end

function GetElementLength(testCase)
% Verify GetElementLength returns the the number of rows as the
% Verify GetElementLength returns the number of rows as the
% length of the element.
import arrow.array.internal.list.TableValidator

Expand Down
2 changes: 1 addition & 1 deletion matlab/test/arrow/array/tChunkedArray.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function TestIsEqualTrue(testCase)
% Verifies ChunkedArrays are considered equal if:
%
% 1. Their Type properties are equal
% 2. Their NumElements properties ar eequal
% 2. Their NumElements properties are equal
% 3. The same elements are considered null
% 4. All corresponding valid elements have the same values
%
Expand Down
2 changes: 1 addition & 1 deletion matlab/test/arrow/array/tFloat32Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function LogicalValidNVPair(testCase)
testCase.verifyEqual(toMATLAB(arrowArray), single([NaN; 2; 3]));
end

function NumericlValidNVPair(testCase)
function NumericValidNVPair(testCase)
matlabArray = single([1 2 3]);

% Supply a numeric vector for Valid
Expand Down
2 changes: 1 addition & 1 deletion matlab/test/arrow/array/tFloat64Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function LogicalValidNVPair(testCase)
testCase.verifyEqual(toMATLAB(arrowArray), [NaN; 2; 3]);
end

function NumericlValidNVPair(testCase)
function NumericValidNVPair(testCase)
matlabArray = [1 2 3];

% Supply a numeric vector for Valid
Expand Down
8 changes: 4 additions & 4 deletions matlab/test/arrow/array/tListArray.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function TestValidationModeDefault(testCase, TestValidationModeArray)

function TestValidationModeNone(testCase, TestValidationModeArray)
% Verify that no error is thrown when supplying the
% ValidatationMode name-value pair, with a value of
% ValidationMode name-value pair, with a value of
% arrow.array.ValidationMode.None, to the
% arrow.array.ListArray.fromArrays method.
offsets = TestValidationModeArray.Offsets;
Expand All @@ -213,7 +213,7 @@ function TestValidationModeNone(testCase, TestValidationModeArray)

function TestValidationModeMinimal(testCase, TestValidationModeArray)
% Verify that an error of type arrow:array:ValidateMinimalFailed
% is thrown when supplying the ValidatationMode name-value pair,
% is thrown when supplying the ValidationMode name-value pair,
% with a value of arrow.array.ValidationMode.Minimal, to the
% arrow.array.ListArray.fromArrays method, if the provided offsets
% and values arrays are invalid.
Expand All @@ -231,7 +231,7 @@ function TestValidationModeMinimal(testCase, TestValidationModeArray)

function TestValidationModeFull(testCase, TestValidationModeArray)
% Verify that an error of type arrow:array:ValidateFullFailed
% is thrown when supplying the ValidatationMode name-value pair,
% is thrown when supplying the ValidationMode name-value pair,
% with a value of arrow.array.ValidationMode.Full, to the
% arrow.array.ListArray.fromArrays method, if the provided offsets
% and values arrays are invalid.
Expand All @@ -250,7 +250,7 @@ function TestValidationModeFull(testCase, TestValidationModeArray)
function TestValidationModeUnsupportedEnum(testCase)
% Verify that an error of type arrow:array:ValidateUnsupportedEnum
% is thrown when an unsupported integer enumeration value is
% supplied for the ValidatationMode parameter to the internal
% supplied for the ValidationMode parameter to the internal
% C++ ListArray Proxy validate method.
offsets = arrow.array.Int32Array.fromMATLAB(int32([0, 1, 2]));
values = arrow.array.Float64Array.fromMATLAB([1, 2, 3]);
Expand Down
2 changes: 1 addition & 1 deletion matlab/test/arrow/array/tTime32Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function TestIsEqualFalse(tc, Unit)
tc.verifyFalse(isequal(array1, array1, array3, array4, array5));
end

function TestIsEqualFalseTimeUnitMistmatch(tc)
function TestIsEqualFalseTimeUnitMismatch(tc)
% Verify two Time32Arrays are not considered equal if they have
% different TimeUnit values.

Expand Down
10 changes: 5 additions & 5 deletions matlab/test/arrow/array/tTime64Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ function TestDuration(testCase, Unit)
function TestValid(testCase, Unit)
% Verify the Valid property returns the expected logical vector.
times = seconds([100 200 NaN 355 NaN 400]);
arrray = testCase.ArrowArrayConstructorFcn(times, TImeUnit=Unit);
testCase.verifyEqual(arrray.Valid, [true; true; false; true; false; true]);
testCase.verifyEqual(toMATLAB(arrray), times');
testCase.verifyEqual(duration(arrray), times');
array = testCase.ArrowArrayConstructorFcn(times, TimeUnit=Unit);
testCase.verifyEqual(array.Valid, [true; true; false; true; false; true]);
testCase.verifyEqual(toMATLAB(array), times');
testCase.verifyEqual(duration(array), times');
end

function InferNullsTrueNVPair(testCase, Unit)
Expand Down Expand Up @@ -299,7 +299,7 @@ function TestIsEqualFalse(tc, Unit)
tc.verifyFalse(isequal(array1, array1, array3, array4, array5));
end

function TestIsEqualFalseTimeUnitMistmatch(tc)
function TestIsEqualFalseTimeUnitMismatch(tc)
% Verify two Time64Arrays are not considered equal if they have
% different TimeUnit values.
times1 = seconds([1 2 3 4]);
Expand Down
4 changes: 2 additions & 2 deletions matlab/test/arrow/array/tTimestampArray.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function TestIsEqualFalse(tc, TimeZone)
tc.verifyFalse(isequal(array1, array1, array3, array4, array5));
end

function TestIsEqualFalseTimeZoneMistmatch(tc)
function TestIsEqualFalseTimeZoneMismatch(tc)
% Verify two TimestampArrays are not considered equal if one
% has a TimeZone and one does not.
dates1 = datetime(2023, 6, 22, TimeZone="America/Anchorage") + days(0:4);
Expand Down Expand Up @@ -263,7 +263,7 @@ function TestIsEqualSameInstantDifferentTimeZone(tc)
tc.verifyFalse(isequal(array1, array2));
end

function TestIsEqualFalseTimeUnitMistmatch(tc, TimeZone)
function TestIsEqualFalseTimeUnitMismatch(tc, TimeZone)
% Verify two TimestampArrays are not considered equal if their
% TimeUnit values differ.
dates1 = datetime(2023, 6, 22, TimeZone=TimeZone) + days(0:4);
Expand Down
10 changes: 5 additions & 5 deletions matlab/test/arrow/internal/validate/index/tNumeric.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
methods (Test)

function NonPositiveError(testCase)
% Verify numeric() throws an error whose idenitifier is
% Verify numeric() throws an error whose identifier is
% "arrow:badsubscript:NonPositive" if the index array provided
% has non-positive values.

Expand All @@ -39,7 +39,7 @@ function NonPositiveError(testCase)
end

function NonIntegerError(testCase)
% Verify numeric() throws an error whose idenitifier is
% Verify numeric() throws an error whose identifier is
% "arrow:badsubscript:NonInteger" if the index array provided
% has non-integer values.

Expand All @@ -61,7 +61,7 @@ function NonIntegerError(testCase)
end

function NonRealError(testCase)
% Verify numeric() throws an error whose idenitifier is
% Verify numeric() throws an error whose identifier is
% "arrow:badsubscript:NonReal" if the index array is
% complex.

Expand All @@ -77,7 +77,7 @@ function NonRealError(testCase)
end

function ExceedsIntMaxError(testCase)
% Verify numeric() throws an error whose idenitifier is
% Verify numeric() throws an error whose identifier is
% "arrow:badsubscript:ExceedsIntMax" if the index array
% provided has values that exceed the intmax(intType).

Expand Down Expand Up @@ -122,7 +122,7 @@ function ConvertSparseToFullStorage(testCase)
end

function ErrorIfNonNumeric(testCase)
% Verify numeric() throws an error whose idenitifer is
% Verify numeric() throws an error whose identifier is
% "arrow:badsubscript:NonNumeric" if provided a non-numeric
% array as the index.

Expand Down
6 changes: 3 additions & 3 deletions matlab/test/arrow/internal/validate/index/tString.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
methods(Test)

function MissingStringError(testCase)
% Verify string() throws an error whose idenitifier is
% Verify string() throws an error whose identifier is
% "arrow:badsubscript:MissingString" if the index array
% provided has mising string values.
% provided has missing string values.

import arrow.internal.validate.*

Expand Down Expand Up @@ -74,7 +74,7 @@ function ValidStringIndices(testCase)
end

function ErrorIfNonString(testCase)
% Verify string() throws an error whose idenitifer is
% Verify string() throws an error whose identifier is
% "arrow:badsubscript:NonString" if neither a string array,
% char array, nor cellstr array was provided as the index.

Expand Down
4 changes: 2 additions & 2 deletions matlab/test/arrow/tabular/tRecordBatch.m
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function FromArraysNoInputs(testCase)
end

function Schema(tc)
% Verify that the public Schema property returns an approprate
% Verify that the public Schema property returns an appropriate
% instance of arrow.tabular.Schema.
t = table(["A"; "B"; "C"], ...
[1; 2; 3], ...
Expand Down Expand Up @@ -331,7 +331,7 @@ function ErrorIfColumnNameDoesNotExist(testCase)
ColumnNames=["A", "B", "C"] ...
);

% Matching should be case sensitive.
% Matching should be case-sensitive.
name = "a";
testCase.verifyError(@() recordBatch.column(name), "arrow:tabular:schema:AmbiguousFieldName");

Expand Down
6 changes: 3 additions & 3 deletions matlab/test/arrow/tabular/tSchema.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function ClassType(testCase)

function ConstructSchemaFromProxy(testCase)
% Verify that an arrow.tabular.Schema instance can be
% constructred directly from an existing
% constructed directly from an existing
% arrow.tabular.proxy.Schema Proxy instance.
schema1 = arrow.schema(arrow.field("a", arrow.uint8));
% Construct an instance of arrow.tabular.Schema directly from a
Expand Down Expand Up @@ -117,7 +117,7 @@ function FieldsNoSetter(testCase)
end

function NumFields(testCase)
% Verify that the NumFields property returns an execpted number
% Verify that the NumFields property returns an expected number
% of fields.
schema = arrow.schema([...
arrow.field("A", arrow.uint8), ...
Expand Down Expand Up @@ -262,7 +262,7 @@ function ErrorIfFieldNameDoesNotExist(testCase)
arrow.field("C", arrow.uint32) ...
]);

% Matching should be case sensitive.
% Matching should be case-sensitive.
fieldName = "a";
testCase.verifyError(@() schema.field(fieldName), "arrow:tabular:schema:AmbiguousFieldName");

Expand Down

0 comments on commit b8d9f0e

Please sign in to comment.