Skip to content

Commit 5d9d9b9

Browse files
committed
correct docstrings
1 parent a6e262c commit 5d9d9b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+200
-144
lines changed

+stdlib/absolute.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
function c = absolute(p, base, expand_tilde, use_java)
21
%% ABSOLUTE Determine absolute path
32
% c = absolute(p);
43
% Path "p" need not exist.
@@ -16,6 +15,8 @@
1615
%
1716
% does not normalize path
1817
% non-existant path is made absolute relative to pwd
18+
19+
function c = absolute(p, base, expand_tilde, use_java)
1920
arguments
2021
p (1,1) string
2122
base string {mustBeScalarOrEmpty} = string.empty

+stdlib/auto_chunk_size.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
function csize = auto_chunk_size(dims)
21
%% AUTO_CHUNK_SIZE determine HDF5 / NetCDF4 chunk size
32
%
43
% based on https://github.com/h5py/h5py/blob/master/h5py/_hl/filters.py
@@ -7,6 +6,7 @@
76
%%% Inputs
87
% * dims: proposed dataset dimensions (like size())
98

9+
function csize = auto_chunk_size(dims)
1010
arguments
1111
dims (1,:) {mustBeInteger,mustBePositive}
1212
end

+stdlib/canonical.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
function c = canonical(p, expand_tilde, use_java)
21
%% CANONICAL Canonicalize path
32
% c = canonical(p);
43
% If exists, canonical absolute path is returned.
@@ -13,6 +12,8 @@
1312
%%% Outputs
1413
% * c: canonical path, if determined
1514
% https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/File.html#getCanonicalPath()
15+
16+
function c = canonical(p, expand_tilde, use_java)
1617
arguments
1718
p (1,1) string
1819
expand_tilde (1,1) logical = true

+stdlib/checkRAM.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
function [OK,newSizeBytes,freebytes] = checkRAM(newSize, myclass)
21
%% CHECKRAN estimate if RAM will fit a new array
32
% checks that requested memory for the new array won't exceed AVAILABLE RAM with Matlab
43
%
54
% This script is optimistic as Matlab won't always be able to
65
% create an array using ALL available RAM, but at least you know when you
76
% certainly CAN'T create an array without digging deep into swap or worse.
87

8+
function [OK,newSizeBytes,freebytes] = checkRAM(newSize, myclass)
99
arguments
1010
newSize (1,:) {mustBeNumeric}
1111
myclass (1,1) string = "double"

+stdlib/cpu_count.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
function N = cpu_count
21
%% CPU_COUNT how many CPUs are available
3-
N = maxNumCompThreads;
4-
if N < 2 % happens on some HPC
5-
N = feature('NumCores');
6-
end
2+
function N = cpu_count()
3+
4+
N = maxNumCompThreads;
5+
if N < 2 % happens on some HPC
6+
N = feature('NumCores');
7+
end
78

89
% logical CPUs
910
% https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Runtime.html#getRuntime()

+stdlib/cpu_load.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
function L = cpu_load()
21
%% CPU_LOAD get total physical CPU load
3-
% https://docs.oracle.com/en/java/javase/21/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getCpuLoad()
42
% Returns the "recent cpu usage" for the whole system.
53
%
64
% This value is a double in the [0.0,1.0] interval.
75
% A value of 0.0 means that all CPUs were idle during the recent period of time observed, while a value of 1.0 means that all CPUs were actively running 100% of the time during the recent period being observed.
86
% All values betweens 0.0 and 1.0 are possible depending of the activities going on in the system.
97
% If the system recent cpu usage is not available, the method returns a negative value.
8+
%
9+
% Ref: https://docs.oracle.com/en/java/javase/21/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getCpuLoad()
10+
11+
function L = cpu_load()
1012

1113
b = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
1214

+stdlib/create_symlink.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
function ok = create_symlink(target, link)
21
%% CREATE_SYMLINK create symbolic link
32
%
43
%%% Inputs
@@ -9,6 +8,8 @@
98
%
109
% Ref: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#createSymbolicLink(java.nio.file.Path,java.nio.file.Path,java.nio.file.attribute.FileAttribute...)
1110

11+
function ok = create_symlink(target, link)
12+
1213
arguments
1314
target (1,1) string
1415
link (1,1) string

+stdlib/diskfree.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
function freebytes = diskfree(direc)
21
%% DISKFREE disk free space
32
% returns disk free space in bytes
43
%
54
% example: diskfree('/')
65
%
76
% Ref: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/File.html#getUsableSpace()
7+
8+
function freebytes = diskfree(d)
89
arguments
9-
direc (1,1) string {mustBeFolder}
10+
d (1,1) string {mustBeFolder}
1011
end
1112

12-
freebytes = java.io.File(direc).getUsableSpace;
13+
freebytes = java.io.File(d).getUsableSpace;
1314

1415
end

+stdlib/exists.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
function ok = exists(p, use_java)
2-
%% EXIST does path exist
1+
%% EXISTS does path exist
2+
%
33
%%% Inputs
44
% * p: path to check
55
%%% Outputs
66
% * ok: true if exists
77
%
88
% Ref: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/File.html#exists()
99

10+
function ok = exists(p, use_java)
1011
arguments
1112
p (1,1) string
1213
use_java (1,1) logical = false

+stdlib/expanduser.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
function e = expanduser(p, use_java)
21
%% EXPANDUSER expands tilde ~ into user home directory
32
%
43
% Useful for Matlab functions that can't handle ~
@@ -7,6 +6,8 @@
76
% * p: path to expand, if tilde present
87
%%% Outputs
98
% * e: expanded path
9+
10+
function e = expanduser(p, use_java)
1011
arguments
1112
p (1,1) string
1213
use_java (1,1) logical = false

0 commit comments

Comments
 (0)