Skip to content

Commit

Permalink
1. Remove nullDetectionFcn input argument from parseValidElements
Browse files Browse the repository at this point in the history
2. Move license header to the top of the file
  • Loading branch information
sgilmore10 committed May 30, 2023
1 parent 355f9ee commit 297f41a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
34 changes: 17 additions & 17 deletions matlab/src/matlab/+arrow/+args/parseValidElements.m
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
function validElements = parseValidElements(data, detectNulls, nullDetectionFcn)
% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
% this work for additional information regarding copyright ownership.
% The ASF licenses this file to you under the Apache License, Version
% 2.0 (the "License"); you may not use this file except in compliance
% with the License. You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
% implied. See the License for the specific language governing
% permissions and limitations under the License.

function validElements = parseValidElements(data, inferNulls)
% Returns a logical vector of the validElements in data. If inferNulls
% is true, calls ismissing on data to determine which elements are
% null.

% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
% this work for additional information regarding copyright ownership.
% The ASF licenses this file to you under the Apache License, Version
% 2.0 (the "License"); you may not use this file except in compliance
% with the License. You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
% implied. See the License for the specific language governing
% permissions and limitations under the License.

if detectNulls
if inferNulls
% TODO: consider making validElements empty if everything is valid.
validElements = ~ismissing(data);
else
Expand Down
30 changes: 15 additions & 15 deletions matlab/src/matlab/+arrow/+args/validateTypeAndShape.m
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
% this work for additional information regarding copyright ownership.
% The ASF licenses this file to you under the Apache License, Version
% 2.0 (the "License"); you may not use this file except in compliance
% with the License. You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
% implied. See the License for the specific language governing
% permissions and limitations under the License.

function validateTypeAndShape(data, type)
% Validates data has the expected type and is a vector or empty 2D
% matrix. If data is numeric, validates is real and nonsparse.

% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
% this work for additional information regarding copyright ownership.
% The ASF licenses this file to you under the Apache License, Version
% 2.0 (the "License"); you may not use this file except in compliance
% with the License. You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
% implied. See the License for the specific language governing
% permissions and limitations under the License.

arguments
data
type(1, 1) string
Expand Down

0 comments on commit 297f41a

Please sign in to comment.