-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use PrettyTables for Available Diagnostics docs
- Loading branch information
1 parent
6bee1ae
commit 8d005ab
Showing
5 changed files
with
33 additions
and
36 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 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,6 @@ | ||
# Available diagnostic variables | ||
|
||
Autogenerate table of available diagnostics: | ||
```@example | ||
include("make_diagnostic_table.jl") | ||
``` |
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,27 @@ | ||
import ClimaAtmos as CA | ||
using PrettyTables | ||
|
||
# Print all available diagnostics to an ASCII table | ||
|
||
short_names = [] | ||
long_names = [] | ||
units = [] | ||
comments = [] | ||
standard_names = [] | ||
for d in values(CA.Diagnostics.ALL_DIAGNOSTICS) | ||
push!(short_names, d.short_name) | ||
push!(long_names, d.long_name) | ||
push!(units, d.units) | ||
push!(comments, d.comments) | ||
push!(standard_names, d.standard_name) | ||
end | ||
data = hcat(short_names, long_names, units, comments, standard_names) | ||
pretty_table( | ||
data; | ||
autowrap = true, | ||
linebreaks = true, | ||
columns_width = [10, 15, 8, 32, 15], # Width = 80 | ||
body_hlines = collect(1:size(data)[1]), | ||
header = ["Short name", "Long name", "Units", "Comments", "Standard name"], | ||
alignment = :l, | ||
) |