Skip to content

Commit

Permalink
Add r2024a support (#21)
Browse files Browse the repository at this point in the history
* Add R2024a testing

* Minor code changes to prevent warnings in R2024a
  • Loading branch information
rpurser47 authored Sep 8, 2024
1 parent 03435ce commit d9c647a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions buildUtilities/codecheckToolbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function codecheckToolbox(rootDir)
error("climatedatastore:codeissues","No files to check.")
end

if verLessThan('matlab','9.13')
if verLessThan('matlab','9.13') %#ok<VERLESSMATLAB>
% Use the old check code before R2022b
issues = checkcode(filesToCheck);
issues = [issues{:}];
Expand All @@ -41,7 +41,7 @@ function codecheckToolbox(rootDir)
writeBadgeJSONFile("code issues",string(issueCount), color)

if issueCount ~= 0
if verLessThan('matlab','9.13')
if verLessThan('matlab','9.13') %#ok<VERLESSMATLAB>
% pre R2022b, run checkcode without a RHS argument to display issues
checkcode(filesToCheck)
else
Expand Down
2 changes: 1 addition & 1 deletion buildUtilities/packageToolbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
oldVersion = string(matlab.addons.toolbox.toolboxVersion(packagingProjectFile));
pat = digitsPattern;
versionParts = extract(oldVersion,pat);
if numel(versionParts) == 1
if numel(versionParts) == 1 %#ok<ISCL> Using numel == 1 for symmetry
versionParts(2) = "0";
end
if numel(versionParts) == 2
Expand Down
2 changes: 1 addition & 1 deletion buildUtilities/testToolbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function testToolbox(options)
results = runner.run(suite);
cdsapi_Factory.useMocks(false);

if ~verLessThan('matlab','9.9') && ~isMATLABReleaseOlderThan("R2022a")
if ~verLessThan('matlab','9.9') && ~isMATLABReleaseOlderThan("R2022a") %#ok<VERLESSMATLAB>
% This report is only available in R2022a and later. isMATLABReleaseOlderThan wasn't added until MATLAB 2020b / version 9.9
results.generateHTMLReport(outputDirectory,'MainFile',"testreport.html");
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>
2 changes: 1 addition & 1 deletion tests/smokeTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function gribAsyncTest(testCase)
verifyClass(testCase, cdsFuture.RunningDuration,?duration)
% This can take a long time. Limit the test to 10 seconds.
cdsFuture.wait(10);
catch e %#ok<NASGU>
catch
assumeFail(testCase,"Timeout waiting for response");
return
end
Expand Down
8 changes: 7 additions & 1 deletion toolbox/internal/setupPythonIfNeeded.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ function setupPythonIfNeeded()
% but for now....
% This is based on
% https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/python-compatibility.pdf
versionInfo = ver('matlab');
if verLessThan('matlab','9.9') %#ok<VERLESSMATLAB>
versionInfo = ver('matlab'); %#ok<VERMATLAB>
else
% matlabRelease ws introduced in R2020b
versionInfo = matlabRelease();
versionInfo = versionInfo.Release;
end
MATLABrelease = extract(string(versionInfo.Release),alphanumericBoundary + alphanumericsPattern + alphanumericBoundary);
switch MATLABrelease
case "R2023a"
Expand Down

0 comments on commit d9c647a

Please sign in to comment.