generated from JuliaAI/MLJExampleInterface.jl
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from JuliaAI/verbosity
Add a global default verbosity
- Loading branch information
Showing
7 changed files
with
72 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const DEFAULT_VERBOSITY = Ref(1) | ||
|
||
""" | ||
LearnAPI.default_verbosity() | ||
LearnAPI.default_verbosity(level::Int) | ||
Respectively return, or set, the default `verbosity` level for LearnAPI.jl methods that | ||
support it, which includes [`fit`](@ref), [`update`](@ref), | ||
[`update_observations`](@ref), and [`update_features`](@ref). The effect in a top-level | ||
call is generally: | ||
| `level` | behaviour | | ||
|:--------|:----------------------------------| | ||
| 1 | informational | | ||
| 0 | warnings only | | ||
| -1 | silent | | ||
Methods consuming `verbosity` generally call other verbosity-supporting methods | ||
at one level lower, so increasing `verbosity` beyond `1` may be useful. | ||
""" | ||
default_verbosity() = DEFAULT_VERBOSITY[] | ||
default_verbosity(level) = (DEFAULT_VERBOSITY[] = level) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using Test | ||
|
||
@test LearnAPI.default_verbosity() ==1 | ||
LearnAPI.default_verbosity(42) | ||
@test LearnAPI.default_verbosity() == 42 | ||
|
||
true |