Skip to content

Commit f18bd47

Browse files
authored
Merge pull request #151 from JuliaAI/deprecate-docstring
Add depwarn for use of `descr` or `docstring` in `metadata_model`
2 parents eca57b1 + fe91b04 commit f18bd47

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/metadata_utils.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ function _extend!(program::Expr, trait::Symbol, value, T)
6565
end
6666
end
6767

68+
const DEPWARN_DOCSTRING =
69+
"`metadata_model` should not be called with the keyword argument "*
70+
"`descr` or `docstring`. Implementers of the MLJ model interface "*
71+
"should instead create an MLJ-compliant docstring in the usual way. "*
72+
"See https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_general_use/#Document-strings for details. "
73+
6874
"""
69-
metadata_model(`T`; args...)
75+
metadata_model(T; args...)
7076
7177
Helper function to write the metadata for a model `T`.
7278
@@ -111,6 +117,7 @@ function metadata_model(
111117
load_path::Union{Nothing,String}=path,
112118
human_name::Union{Nothing,String}=nothing
113119
)
120+
docstring === nothing || Base.depwarn(DEPWARN_DOCSTRING, :metadata_model)
114121

115122
program = quote end
116123

0 commit comments

Comments
 (0)