Skip to content

Commit 9ef05b5

Browse files
committed
updating error messages, clean-up, restricting remote test to >=R2024b
1 parent 0c71ca9 commit 9ef05b5

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.github/workflows/test_setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macos-14]
11-
matlab-version: ['R2024b']
11+
matlab-version: ['R2024a', 'R2024b']
1212

1313
steps:
1414
- name: Checkout code

Zarr.m

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function pyReloadInProcess()
106106
if any(params>dims)
107107
error("MATLAB:Zarr:PartialReadOutOfBounds",...
108108
"Elements in %s must not exceed "+...
109-
"the corresponding Zarr array dimensions (%s).",...
110-
paramName, join(string(dims), "x"))
109+
"the corresponding Zarr array dimensions.",...
110+
paramName)
111111
end
112112

113113
newParams = params;
@@ -325,8 +325,7 @@ function makeZarrGroups(existingParentPath, newGroupsPath)
325325
if any(count>maxCount)
326326
error("MATLAB:Zarr:PartialReadOutOfBounds",...
327327
"Requested Count in combination with other "+...
328-
"partial read parameters exceeds "+...
329-
"Zarr array dimensions.")
328+
"parameters exceeds Zarr array dimensions.")
330329
end
331330

332331
% Convert partial read parameters to tensorstore-style
@@ -344,19 +343,16 @@ function makeZarrGroups(existingParentPath, newGroupsPath)
344343
zeros(count, obj.Datatype.MATLABType);
345344
catch ME
346345
if strcmp(ME.identifier, 'MATLAB:array:SizeLimitExceeded')
347-
%rethrow(ME)
348346
error("MATLAB:Zarr:OutOfMemory",...
349-
"Reading requested data (%s %s array) "+...
347+
"Reading requested data (%s %s matrix) "+...
350348
"might exceed available memory.",...
351-
join(string(count), "x"), obj.Datatype.MATLABType)
349+
join(string(count), "-by-"), obj.Datatype.MATLABType)
352350
end
353351
end
354352

355353
% Read the data
356354
ndArrayData = Zarr.ZarrPy.readZarr(obj.KVStoreSchema,...
357355
start, endInds, stride);
358-
359-
% assert(ndArrayData.dtype.name == obj.Datatype.TensorstoreType)
360356

361357
% Convert the numpy array to MATLAB array
362358
data = cast(ndArrayData, obj.Datatype.MATLABType);

test/tZarrRead.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ function tooBigArray(testcase)
113113
% Verify zarrread error when a user tries to read data that is
114114
% too large
115115

116+
testcase.assumeFalse(isMATLABReleaseOlderThan('R2024b'),...
117+
"Remote workflows are fully supported only from R2024b")
116118
errID = 'MATLAB:Zarr:OutOfMemory';
117119
bigData = 'https://noaa-nwm-retro-v2-zarr-pds.s3.amazonaws.com/elevation/';
118120
testcase.verifyError(@()zarrread(bigData,Count=[100000,100000]),errID);

0 commit comments

Comments
 (0)