Skip to content

Commit 52ce16d

Browse files
committed
Refactoring
1 parent 85649da commit 52ce16d

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

scripts/stats.jl

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,38 @@
11
# Copyright (c) 2025 Uwe Fechner
22
# SPDX-License-Identifier: BSD-3-Clause
33

4-
# List all methods of VortexStepMethod
5-
using VortexStepMethod
4+
# List all methods of VortexStepMethod and report if they are documented;
5+
# By default, also exported constants are reported
6+
using VortexStepMethod
67

78
exported_names = names(VortexStepMethod)
89
exported_functions = filter(n -> isdefined(VortexStepMethod, n) && isa(getfield(VortexStepMethod, n), Function), exported_names)
9-
println("Exported methods:\n")
10-
total = 0
11-
for fun in exported_functions
12-
global total
13-
f = getfield(VortexStepMethod, fun)
14-
mes = methods(f)
15-
for me in mes
16-
println(split(repr(me),'@')[1])
17-
total += 1
10+
11+
function find_exported_functions(exported_functions)
12+
total = 0
13+
for fun in exported_functions
14+
f = getfield(VortexStepMethod, fun)
15+
mes = methods(f)
16+
for me in mes
17+
println(split(repr(me),'@')[1])
18+
total += 1
19+
end
1820
end
21+
return total
1922
end
23+
24+
println("Exported methods:\n")
25+
total = find_exported_functions(exported_functions)
2026
println("\nTotal: $total")
2127

22-
function check_exported_docs(mod::Module)
28+
function check_exported_docs(mod::Module; only_functions=false)
2329
exported_symbols = names(mod, all=false)
2430
doc_status = Dict{Symbol,Bool}()
2531
for sym in exported_symbols
26-
#if isa(getfield(mod, sym), Function)
27-
doc_status[sym] = Base.Docs.hasdoc(mod, sym)
28-
#end
32+
if only_functions && !isa(getfield(mod, sym), Function)
33+
continue
34+
end
35+
doc_status[sym] = Base.Docs.hasdoc(mod, sym)
2936
end
3037
return doc_status
3138
end

0 commit comments

Comments
 (0)