From 85649da3e63032ae6881cdb164f14ab14ecc23f7 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Wed, 13 Aug 2025 21:00:26 +0200 Subject: [PATCH 1/6] Add stats.jl script --- scripts/stats.jl | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scripts/stats.jl diff --git a/scripts/stats.jl b/scripts/stats.jl new file mode 100644 index 00000000..a95b04ee --- /dev/null +++ b/scripts/stats.jl @@ -0,0 +1,36 @@ +# Copyright (c) 2025 Uwe Fechner +# SPDX-License-Identifier: BSD-3-Clause + +# List all methods of VortexStepMethod +using VortexStepMethod + +exported_names = names(VortexStepMethod) +exported_functions = filter(n -> isdefined(VortexStepMethod, n) && isa(getfield(VortexStepMethod, n), Function), exported_names) +println("Exported methods:\n") +total = 0 +for fun in exported_functions + global total + f = getfield(VortexStepMethod, fun) + mes = methods(f) + for me in mes + println(split(repr(me),'@')[1]) + total += 1 + end +end +println("\nTotal: $total") + +function check_exported_docs(mod::Module) + exported_symbols = names(mod, all=false) + doc_status = Dict{Symbol,Bool}() + for sym in exported_symbols + #if isa(getfield(mod, sym), Function) + doc_status[sym] = Base.Docs.hasdoc(mod, sym) + #end + end + return doc_status +end + +# Usage example: +results = check_exported_docs(VortexStepMethod) +undocumented = filter(kv -> !kv[2], results) +println("\nUndocumented exported symbols: \n", keys(undocumented)) From 52ce16d356ea7cb6daccce6727f11ee692d38cdb Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Wed, 13 Aug 2025 21:16:47 +0200 Subject: [PATCH 2/6] Refactoring --- scripts/stats.jl | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/scripts/stats.jl b/scripts/stats.jl index a95b04ee..12d85c2e 100644 --- a/scripts/stats.jl +++ b/scripts/stats.jl @@ -1,31 +1,38 @@ # Copyright (c) 2025 Uwe Fechner # SPDX-License-Identifier: BSD-3-Clause -# List all methods of VortexStepMethod -using VortexStepMethod +# List all methods of VortexStepMethod and report if they are documented; +# By default, also exported constants are reported +using VortexStepMethod exported_names = names(VortexStepMethod) exported_functions = filter(n -> isdefined(VortexStepMethod, n) && isa(getfield(VortexStepMethod, n), Function), exported_names) -println("Exported methods:\n") -total = 0 -for fun in exported_functions - global total - f = getfield(VortexStepMethod, fun) - mes = methods(f) - for me in mes - println(split(repr(me),'@')[1]) - total += 1 + +function find_exported_functions(exported_functions) + total = 0 + for fun in exported_functions + f = getfield(VortexStepMethod, fun) + mes = methods(f) + for me in mes + println(split(repr(me),'@')[1]) + total += 1 + end end + return total end + +println("Exported methods:\n") +total = find_exported_functions(exported_functions) println("\nTotal: $total") -function check_exported_docs(mod::Module) +function check_exported_docs(mod::Module; only_functions=false) exported_symbols = names(mod, all=false) doc_status = Dict{Symbol,Bool}() for sym in exported_symbols - #if isa(getfield(mod, sym), Function) - doc_status[sym] = Base.Docs.hasdoc(mod, sym) - #end + if only_functions && !isa(getfield(mod, sym), Function) + continue + end + doc_status[sym] = Base.Docs.hasdoc(mod, sym) end return doc_status end From f1152a9d35934e5bf1ed1b76aab8a095378c5f8f Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Wed, 13 Aug 2025 21:18:21 +0200 Subject: [PATCH 3/6] Update scripts/stats.jl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- scripts/stats.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stats.jl b/scripts/stats.jl index 12d85c2e..c158bb5d 100644 --- a/scripts/stats.jl +++ b/scripts/stats.jl @@ -14,7 +14,7 @@ function find_exported_functions(exported_functions) f = getfield(VortexStepMethod, fun) mes = methods(f) for me in mes - println(split(repr(me),'@')[1]) + println(me.sig) total += 1 end end From 0a3491953512bc4c5a85e0ed420d5232e39646a5 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Wed, 13 Aug 2025 21:19:24 +0200 Subject: [PATCH 4/6] Update scripts/stats.jl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- scripts/stats.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stats.jl b/scripts/stats.jl index c158bb5d..4b735b38 100644 --- a/scripts/stats.jl +++ b/scripts/stats.jl @@ -37,7 +37,7 @@ function check_exported_docs(mod::Module; only_functions=false) return doc_status end -# Usage example: +# Main execution block: results = check_exported_docs(VortexStepMethod) undocumented = filter(kv -> !kv[2], results) println("\nUndocumented exported symbols: \n", keys(undocumented)) From fa0021a445d44214168f0a8d891ebc070fff3166 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Wed, 13 Aug 2025 21:20:00 +0200 Subject: [PATCH 5/6] Update scripts/stats.jl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- scripts/stats.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/stats.jl b/scripts/stats.jl index 4b735b38..6c426cdc 100644 --- a/scripts/stats.jl +++ b/scripts/stats.jl @@ -29,7 +29,8 @@ function check_exported_docs(mod::Module; only_functions=false) exported_symbols = names(mod, all=false) doc_status = Dict{Symbol,Bool}() for sym in exported_symbols - if only_functions && !isa(getfield(mod, sym), Function) + val = getfield(mod, sym) + if only_functions && !isa(val, Function) continue end doc_status[sym] = Base.Docs.hasdoc(mod, sym) From 9c12f66a3adc96943363e61da91a94f3ce5ffc4c Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Wed, 13 Aug 2025 22:23:48 +0200 Subject: [PATCH 6/6] Change license to MIT --- scripts/stats.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stats.jl b/scripts/stats.jl index 6c426cdc..ff1c0336 100644 --- a/scripts/stats.jl +++ b/scripts/stats.jl @@ -1,5 +1,5 @@ # Copyright (c) 2025 Uwe Fechner -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: MIT # List all methods of VortexStepMethod and report if they are documented; # By default, also exported constants are reported