Skip to content

Merging doc-branch with main #66

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

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6de39a2
Merge pull request #1 from mathworks/test-branch
abhibaruah Mar 11, 2025
de0a0ac
Merge pull request #2 from mathworks/test-branch
abhibaruah Mar 17, 2025
3a187a7
Merge pull request #3 from mathworks/test-branch
abhibaruah Mar 18, 2025
f288ddc
Merge pull request #4 from mathworks/test-branch
abhibaruah Mar 18, 2025
7c5f5b6
Merge pull request #5 from mathworks/test-branch
abhibaruah Mar 19, 2025
30308a2
Merge pull request #6 from mathworks/test-branch
abhibaruah Mar 19, 2025
601727e
Merge pull request #7 from mathworks/test-branch
abhibaruah Mar 19, 2025
db6a90e
Merge pull request #8 from mathworks/test-branch
abhibaruah Mar 21, 2025
aa1ff51
Merge pull request #10 from mathworks/test-branch
abhibaruah Mar 31, 2025
18d2e9d
Merge pull request #15 from mathworks/test-branch
abhibaruah Apr 1, 2025
36cdd00
Merge pull request #16 from mathworks/test-branch
abhibaruah Apr 1, 2025
2912ccf
Merge pull request #17 from mathworks/test-branch
abhibaruah Apr 2, 2025
23fc155
Merge pull request #18 from mathworks/test-branch
abhibaruah Apr 2, 2025
bb3ae32
Merge pull request #20 from mathworks/test-branch
abhibaruah Apr 3, 2025
4849340
Merge pull request #29 from mathworks/test-branch
abhibaruah Apr 8, 2025
c09454e
Merge pull request #32 from mathworks/test-branch
abhibaruah Apr 9, 2025
2da7481
Merge pull request #33 from mathworks/test-branch
abhibaruah Apr 9, 2025
10b3ec0
Merge pull request #39 from mathworks/test-branch
abhibaruah Apr 11, 2025
961f516
Merge pull request #41 from mathworks/test-branch
abhibaruah Apr 11, 2025
95ae0a1
Merge pull request #42 from mathworks/test-branch
abhibaruah Apr 11, 2025
03f2d63
Merge pull request #43 from mathworks/test-branch
abhibaruah Apr 11, 2025
9e690fd
Merge pull request #46 from mathworks/test-branch
abhibaruah Apr 18, 2025
b64e744
Address CR feedback
Apr 18, 2025
cb75b74
Merge pull request #49 from mathworks/test-branch
abhibaruah Apr 18, 2025
c20122a
Adding tests v1
jm9176 Apr 18, 2025
49847d7
Error on array creation when the ChunkSize is greater than the array …
Apr 18, 2025
df0afe4
Remove test file added accidently
Apr 18, 2025
d07abfb
Testing branch submission v2
jm9176 Apr 18, 2025
76b1485
Adding tests v1
jm9176 Apr 18, 2025
557e736
Testing branch submission v2
jm9176 Apr 18, 2025
20c3377
Testing branch submission v2
jm9176 Apr 18, 2025
2f57218
Testing branch submission v2
jm9176 Apr 18, 2025
d81ab97
Testing branch submission v2
jm9176 Apr 18, 2025
05bc6e2
Testing branch submission v2
jm9176 Apr 18, 2025
581c917
Testing branch submission - multiple platforms
jm9176 Apr 18, 2025
f267fb0
Testing branch submission - multiple platforms
jm9176 Apr 18, 2025
5e570d0
Update README.md
abhibaruah Apr 21, 2025
0617579
Merge pull request #53 from mathworks/abhibaruah-patch-1
abhibaruah Apr 21, 2025
4c613d5
Merge pull request #54 from mathworks/main
abhibaruah Apr 21, 2025
b3cb72d
Update README.md
abhibaruah Apr 21, 2025
1f30070
Merge pull request #55 from mathworks/abhibaruah-patch-1
abhibaruah Apr 21, 2025
de1e110
Merge pull request #50 from mathworks/add-test-branch
jm9176 Apr 21, 2025
6991cce
Updating test data
jm9176 Apr 21, 2025
eab59de
Updating test data
jm9176 Apr 21, 2025
0416ba2
Removed test temporary configuration
jm9176 Apr 21, 2025
55c8d80
Merge pull request #56 from mathworks/add-test-branch
jm9176 Apr 21, 2025
4bd777c
Address code review for #51
Apr 25, 2025
d14dffb
Merge pull request #51 from mathworks/test-branch
abhibaruah Apr 25, 2025
091a871
Remove space in README.md
Apr 25, 2025
17eb019
Merge pull request #60 from mathworks/test-branch
abhibaruah Apr 25, 2025
bd03ac9
Filtering tests in tZarrCreate.m
Apr 25, 2025
0c96a28
Merge pull request #63 from mathworks/test-branch
abhibaruah Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/test_setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run Tests

on:
push:
branches:
- main

jobs:
test:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-14]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up MATLAB R2024a
uses: matlab-actions/setup-matlab@v2
with:
release: R2024a

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.9'

- name: Install additional 3p dependencies
run: |
python -m pip install --upgrade pip
pip install numpy==1.26.4 tensorstore==0.1.73

- name: Run tests
uses: matlab-actions/run-tests@v2
with:
select-by-folder: 'test'
code-coverage-cobertura: cobertura.xml

- name: Upload codecov
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
files: ./target/site/cobertura/coverage.xml
name: codecov-umbrella.xml
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![codecov](https://codecov.io/gh/mathworks/MATLAB-support-for-Zarr-files/graph/badge.svg?token=ZBLNDOLQyA)](https://codecov.io/gh/mathworks/MATLAB-support-for-Zarr-files)

# MATLAB Support for Zarr files

[Zarr®](https://zarr-specs.readthedocs.io/en/latest/specs.html) is a chunked, compressed, _N_-dimensional array storage format optimized for performance and scalability. It is widely used in scientific computing for handling large arrays efficiently.
Expand Down Expand Up @@ -77,7 +79,7 @@ filepath = "myZarrfiles\singleDset";
data_shape = [10,10]; % shape of the Zarr array to be written
data = 5*ones(10,10); % Data to be written

zarrcreate (filepath, data_shape) % Create the Zarr array with default attributes
zarrcreate(filepath, data_shape) % Create the Zarr array with default attributes
zarrwrite(filepath, data) % Write data to the Zarr array
```

Expand Down Expand Up @@ -127,4 +129,4 @@ The license is available in the `License.txt` file in this GitHub repository.
## Community Support
[MATLAB Central](https://www.mathworks.com/matlabcentral)

Copyright 2025 The MathWorks, Inc.
Copyright 2025 The MathWorks, Inc.
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
target: 85%
threshold: 5%
ignore:
- "test/*"
2 changes: 1 addition & 1 deletion readZattrs.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function zattrsStruct = readZattrs(filepath)
%READZATTRS Helper function to read the JSON file .zattrs which contains
%user defined attributes for a Zarr array or group.
%user-defined attributes for a Zarr array or group.

% Copyright 2025 The MathWorks, Inc.

Expand Down
28 changes: 28 additions & 0 deletions test/SharedZarrTestSetup.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
classdef SharedZarrTestSetup < matlab.unittest.TestCase
% Shared test set up for Zarr tests.

% Copyright 2025 The MathWorks, Inc.

properties
PyException = "MATLAB:Python:PyException"
ArrSize = [20 25]
ChunkSize = [4 5]

% Path for write tests
ArrPathWrite = "prt_grp_write/arr1"
end

methods(TestClassSetup)
function addSrcCodePath(testcase)
% Add source code path before running the tests
import matlab.unittest.fixtures.PathFixture
testcase.applyFixture(PathFixture(fullfile('..'),'IncludeSubfolders',true))
end

function setupWorkingFolderToCreateArr(testcase)
% Use working folder fixture to create Zarr array.
import matlab.unittest.fixtures.WorkingFolderFixture;
testcase.applyFixture(WorkingFolderFixture);
end
end
end
Binary file added test/dataFiles/expZarrArrData.mat
Binary file not shown.
Binary file added test/dataFiles/expZarrArrInfo.mat
Binary file not shown.
4 changes: 4 additions & 0 deletions test/dataFiles/grp_v2/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"group_description": "This is a sample Zarr group",
"group_level": 1
}
3 changes: 3 additions & 0 deletions test/dataFiles/grp_v2/.zgroup
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"zarr_format": 2
}
1 change: 1 addition & 0 deletions test/dataFiles/grp_v2/arr_v2/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"chunks":[2,5],"compressor":{"blocksize":0,"clevel":5,"cname":"lz4","id":"blosc","shuffle":1},"dtype":"<f4","fill_value":-9,"filters":[],"order":"C","shape":[20,25],"zarr_format":2,"Attr1":"var"}
5 changes: 5 additions & 0 deletions test/dataFiles/grp_v2/arr_v2/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"array_description": "This is a sample Zarr array",
"array_level": 1,
"array_type": "double"
}
Binary file added test/dataFiles/grp_v2/arr_v2/0.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/0.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/0.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/0.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/0.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/1.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/1.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/1.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/1.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/1.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/2.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/2.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/2.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/2.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/2.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/3.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/3.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/3.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/3.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/3.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/4.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/4.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/4.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/4.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/4.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/5.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/5.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/5.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/5.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/5.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/6.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/6.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/6.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/6.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/6.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/7.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/7.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/7.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/7.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/7.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/8.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/8.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/8.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/8.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/8.4
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/9.0
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/9.1
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/9.2
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/9.3
Binary file not shown.
Binary file added test/dataFiles/grp_v2/arr_v2/9.4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/0/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/0/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/0/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/0/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/0/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/1/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/1/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/1/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/1/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/1/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/2/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/2/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/2/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/2/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/2/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/3/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/3/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/3/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/3/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/3/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/4/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/4/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/4/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/4/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/4/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/5/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/5/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/5/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/5/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/5/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/6/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/6/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/6/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/6/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/6/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/7/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/7/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/7/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/7/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/7/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/8/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/8/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/8/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/8/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/8/4
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/9/0
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/9/1
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/9/2
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/9/3
Binary file not shown.
Binary file added test/dataFiles/grp_v3/arr_v3/c/9/4
Binary file not shown.
46 changes: 46 additions & 0 deletions test/dataFiles/grp_v3/arr_v3/zarr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"shape": [
20,
25
],
"data_type": "float32",
"chunk_grid": {
"name": "regular",
"configuration": {
"chunk_shape": [
2,
5
]
}
},
"chunk_key_encoding": {
"name": "default",
"configuration": {
"separator": "/"
}
},
"fill_value": -9.0,
"codecs": [
{
"name": "bytes",
"configuration": {
"endian": "little"
}
},
{
"name": "zstd",
"configuration": {
"level": 0,
"checksum": false
}
}
],
"attributes": {
"array_description": "This is a sample Zarr array",
"array_type": "double",
"array_level": 1
},
"zarr_format": 3,
"node_type": "array",
"storage_transformers": []
}
9 changes: 9 additions & 0 deletions test/dataFiles/grp_v3/zarr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"attributes": {
"group_description": "This is a sample Zarr group",
"group_level": 1
},
"zarr_format": 3,
"consolidated_metadata": null,
"node_type": "group"
}
108 changes: 108 additions & 0 deletions test/tZarrAttributes.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
classdef tZarrAttributes < SharedZarrTestSetup
% Tests for zarrwriteatt function to get attribute info of the Zarr file in MATLAB.

% Copyright 2025 The MathWorks, Inc.

methods(TestClassSetup)
function createZarrArrayWithAttrs(testcase)
% Create Zarr array and add some attributes.
zarrcreate(testcase.ArrPathWrite,testcase.ArrSize);
zarrwriteatt(testcase.ArrPathWrite,'attr1','This is an array attribute.');
zarrwriteatt(testcase.ArrPathWrite,'attr2',{1,2,3});
attr3.numVal = 10;
attr3.strArr = ["array","attribute"];
zarrwriteatt(testcase.ArrPathWrite,'attr3',attr3);
end
end

methods(Test)
function verifyArrayAttributeInfo(testcase)
% Write attribute info using zarrwriteatt function to an array.

arrInfo = zarrinfo(testcase.ArrPathWrite);
actAttr.attr1 = arrInfo.attr1;

% TODO: Enable code once Issue-34 is fixed.
%actAttr.attr2 = arrInfo.attr2;
%actAttr.attr3 = arrInfo.attr3;

expAttr.attr1 = 'This is an array attribute.';
%expAttr.attr2 = {1,2,3};
%expAttr.attr3.numVal = 10;
%expAttr.attr4.strArr = ["array","attribute"];

testcase.verifyEqual(actAttr,expAttr,'Failed to verify attribute info.');
end

function verifyAttrOverwrite(testcase)
% Verify attribute value after overwrite.
%testcase.assumeTrue(false,'Filtered until the attributes display is fixed.');
expAttrStr = ["new","attribute","value"];
zarrwriteatt(testcase.ArrPathWrite,'attr1',expAttrStr);
expAttrDbl = 10;
zarrwriteatt(testcase.ArrPathWrite,'attr2',expAttrDbl);

arrInfo = zarrinfo(testcase.ArrPathWrite);

% TODO: Enable code once Issue-34 is fixed.
%actAttrStr = arrInfo.attr1;
actAttrDbl = arrInfo.attr2;

%testcase.verifyEqual(actAttrStr,expAttrStr,'Failed to verify string attribute info');
testcase.verifyEqual(actAttrDbl,expAttrDbl,'Failed to verify double attribute info');
end

function verifyGroupAttributeInfo(testcase)
% Write attribute info using zarrwriteatt function to a group.
testcase.assumeTrue(false,'Filtered until Issue-35 is fixed.');

% Unable to read attribute data from a group/array created
% using Python.
end

function verifyZarrV3WriteError(testcase)
% Verify error when a user tries to write attribute to zarr v3
% file.
testcase.assumeTrue(false,'Filtered until the right error message is thrown.');
filePath = 'dataFiles/grp_v3/arr_v3';
testcase.verifyError(@()zarrwriteatt(filePath,'myAttr','attrVal'), ...
testcase.PyException);
end

function nonExistentFile(testcase)
% Verify error when using a non-existent file with zarrwriteatt
% function.
testcase.verifyError(@()zarrwriteatt('testFile/nonExistentArr','myAttr','attrVal'), ...
'MATLAB:validators:mustBeFolder');
end

function tooManyInputs(testcase)
% Verify error when too many inputs are used with zarrwrite
% function.
testcase.verifyError(@()zarrwriteatt(testcase.ArrPathWrite,'myAttr','attrVal','extra'), ...
'MATLAB:TooManyInputs');
end

function tooFewInputs(testcase)
% Verify error when too few inputs with zarrwriteatt function
% are used.
testcase.verifyError(@()zarrwriteatt(testcase.ArrPathWrite,'myAttr'), ...
'MATLAB:minrhs');
end

function invalidInput(testcase)
% Verify error when invalid input is used for zarrwriteatt
% function.
errID = 'MATLAB:validators:mustBeFolder';

% Invalid file path type
testcase.verifyError(@()zarrwriteatt('nonexistent','myAttr',10),errID);

% Invalid attribute name
errID = 'MATLAB:validators:mustBeNonzeroLengthText';
testcase.verifyError(@()zarrwriteatt(testcase.ArrPathWrite,'',10),errID);
errID = 'MATLAB:validators:mustBeTextScalar';
testcase.verifyError(@()zarrwriteatt(testcase.ArrPathWrite,10,10),errID);
end
end
end
Loading