-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Configurations.jl for kwarg handling (#9)
* Add `HeatmapOptions` struct via Configurations.jl to handle keyword arguments * Reorganized source code, adding config.jl file, removing xaibase.jl and moving all `heatmap` methods into heatmap.jl
- Loading branch information
Showing
98 changed files
with
263 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const DEFAULT_COLORSCHEME = :seismic | ||
const DEFAULT_REDUCE = :sum | ||
const DEFAULT_RANGESCALE = :centered | ||
|
||
@option struct HeatmapOptions | ||
colorscheme::Union{ColorScheme,Symbol} = DEFAULT_COLORSCHEME | ||
reduce::Symbol = DEFAULT_REDUCE | ||
rangescale::Symbol = DEFAULT_RANGESCALE | ||
permute::Bool = true | ||
process_batch::Bool = false | ||
unpack_singleton::Bool = true | ||
end | ||
|
||
get_colorscheme(options::HeatmapOptions) = get_colorscheme(options.colorscheme) | ||
get_colorscheme(c::ColorScheme) = c | ||
get_colorscheme(s::Symbol)::ColorScheme = colorschemes[s] | ||
|
||
#=================# | ||
# XAIBase support # | ||
#=================# | ||
|
||
const HEATMAP_PRESETS = Dict{ | ||
Symbol,@NamedTuple{colorscheme::Symbol, reduce::Symbol, rangescale::Symbol} | ||
}( | ||
:attribution => (colorscheme=:seismic, reduce=:sum, rangescale=:centered), | ||
:sensitivity => (colorscheme=:grays, reduce=:norm, rangescale=:extrema), | ||
:cam => (colorscheme=:jet, reduce=:sum, rangescale=:extrema), | ||
) | ||
const DEFAULT_HEATMAP_PRESET = ( | ||
colorscheme=DEFAULT_COLORSCHEME, reduce=DEFAULT_REDUCE, rangescale=DEFAULT_RANGESCALE | ||
) | ||
|
||
# Override HeatmapOptions preset with keyword arguments | ||
function HeatmapOptions(expl::Explanation; kwargs...) | ||
c = get(HEATMAP_PRESETS, expl.heatmap, DEFAULT_HEATMAP_PRESET) | ||
return HeatmapOptions(; | ||
colorscheme=c.colorscheme, reduce=c.reduce, rangescale=c.rangescale, kwargs... | ||
) | ||
end |
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 was deleted.
Oops, something went wrong.
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 @@ | ||
[0m[38;5;160;48;5;124m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;124m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;124m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;124;48;5;88m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;124;48;5;88m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;124;48;5;88m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;124m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;124m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;124m▀[38;5;124;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
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 @@ | ||
[0m[38;5;17;48;5;203m▀[38;5;63;48;5;88m▀[0m |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
[0m[38;5;160;48;5;54m▀[38;5;100;48;5;138m▀[0m |
File renamed without changes.
File renamed without changes.
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 @@ | ||
[0m[38;5;88;48;5;133m▀[38;5;31;48;5;138m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;54m▀[38;5;100;48;5;138m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;54m▀[38;5;100;48;5;138m▀[0m |
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 @@ | ||
[0m[38;5;160;48;5;54m▀[38;5;100;48;5;138m▀[0m |
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 @@ | ||
[0m[38;5;88;48;5;133m▀[38;5;31;48;5;138m▀[0m |
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 @@ | ||
[0m[38;5;88;48;5;133m▀[38;5;31;48;5;138m▀[0m |
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 @@ | ||
[0m[38;5;88;48;5;133m▀[38;5;31;48;5;138m▀[0m |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,3 @@ | ||
[0m[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;88;48;5;124m▀[38;5;88;48;5;124m▀[38;5;88;48;5;124m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;130;48;5;130m▀[38;5;130;48;5;130m▀[38;5;136;48;5;136m▀[0m |
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,3 @@ | ||
[0m[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;88;48;5;124m▀[38;5;88;48;5;124m▀[38;5;88;48;5;124m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;130;48;5;130m▀[38;5;130;48;5;130m▀[38;5;136;48;5;136m▀[0m |
File renamed without changes.
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,3 @@ | ||
[0m[38;5;16;48;5;16m▀[38;5;16;48;5;16m▀[38;5;17;48;5;17m▀[38;5;24;48;5;60m▀[38;5;31;48;5;67m▀[38;5;31;48;5;67m▀[0m | ||
[0m[38;5;52;48;5;124m▀[38;5;52;48;5;130m▀[38;5;59;48;5;130m▀[38;5;60;48;5;94m▀[38;5;66;48;5;94m▀[38;5;66;48;5;100m▀[0m | ||
[0m[38;5;167;48;5;203m▀[38;5;167;48;5;203m▀[38;5;166;48;5;166m▀[38;5;130;48;5;130m▀[38;5;130;48;5;130m▀[38;5;136;48;5;136m▀[0m |
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,3 @@ | ||
[0m[38;5;16;48;5;16m▀[38;5;16;48;5;16m▀[38;5;17;48;5;17m▀[38;5;24;48;5;60m▀[38;5;31;48;5;67m▀[38;5;31;48;5;67m▀[0m | ||
[0m[38;5;52;48;5;124m▀[38;5;52;48;5;130m▀[38;5;59;48;5;130m▀[38;5;60;48;5;94m▀[38;5;66;48;5;94m▀[38;5;66;48;5;100m▀[0m | ||
[0m[38;5;167;48;5;203m▀[38;5;167;48;5;203m▀[38;5;166;48;5;166m▀[38;5;130;48;5;130m▀[38;5;130;48;5;130m▀[38;5;136;48;5;136m▀[0m |
File renamed without changes.
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,3 @@ | ||
[0m[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;130;48;5;130m▀[38;5;130;48;5;130m▀[38;5;136;48;5;136m▀[0m |
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,3 @@ | ||
[0m[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;88;48;5;88m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;94;48;5;94m▀[38;5;94;48;5;94m▀[38;5;100;48;5;100m▀[0m | ||
[0m[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;124;48;5;124m▀[38;5;130;48;5;130m▀[38;5;130;48;5;130m▀[38;5;136;48;5;136m▀[0m |
File renamed without changes.
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,3 @@ | ||
[0m[38;5;16;48;5;16m▀[38;5;16;48;5;16m▀[38;5;17;48;5;17m▀[38;5;24;48;5;60m▀[38;5;31;48;5;67m▀[38;5;31;48;5;67m▀[0m | ||
[0m[38;5;52;48;5;125m▀[38;5;52;48;5;131m▀[38;5;59;48;5;130m▀[38;5;60;48;5;94m▀[38;5;66;48;5;94m▀[38;5;66;48;5;100m▀[0m | ||
[0m[38;5;167;48;5;203m▀[38;5;167;48;5;203m▀[38;5;166;48;5;166m▀[38;5;130;48;5;130m▀[38;5;130;48;5;130m▀[38;5;136;48;5;136m▀[0m |
Oops, something went wrong.