Skip to content

Commit 21d4344

Browse files
committed
add nc_get_version()
1 parent eaa1c7e commit 21d4344

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

+stdlib/nc_get_version.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
%% NC_GET_VERSION get NetCDF library version
2+
3+
function v = nc_get_version()
4+
5+
v = netcdf.inqLibVers;
6+
7+
end

+stdlib/platform_tell.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ function platform_tell()
55
r = matlabRelease();
66
fprintf('Matlab: %s %s %s\n', r.Release, computer('arch'), stdlib.cpu_arch());
77

8+
fprintf('HDF5 %s\n', stdlib.h5get_version());
9+
fprintf('netCDF %s\n', stdlib.nc_get_version());
10+
811
if stdlib.has_java()
912
fprintf('Java: %s %s Home: %s\n', stdlib.java_vendor(), stdlib.java_version(), stdlib.java_home());
1013
end

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Filesystem.class
22
CodeIssues.sarif
33
*.xml
4+
*.html
45

56
resources/
67
.buildtool/

test/TestHDF5.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ function test_auto_chunk_size(tc)
8686
tc.verifyEqual(stdlib.auto_chunk_size([15,250]), [15,250])
8787
end
8888

89+
function test_hdf5_version(tc)
90+
tc.verifyTrue(stdlib.version_atleast(stdlib.h5get_version(), "1.8"), "version unexpected")
91+
end
92+
8993

9094
function test_get_variables(tc)
9195

test/TestNetCDF.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ function remove_temp_wd(tc)
7373

7474
methods (Test, TestTags="netcdf")
7575

76-
function test_get_variables(tc)
77-
76+
function test_betcdf_version(tc)
77+
tc.verifyTrue(stdlib.version_atleast(stdlib.nc_get_version(), "4.7"), "version unexpected")
78+
end
7879

80+
function test_get_variables(tc)
7981
k = ["A0", "A1", "A2", "A3", "A4"];
8082

8183
if ~isMATLABReleaseOlderThan('R2021b')

0 commit comments

Comments
 (0)