Library
Documentation for the public user interface.
Oceanostics._show_diagnostic — Method
Print Oceananigans' KFO tree for op, then a └── computes: … line with the diagnostic's description. On color-capable streams the leading name in the header and the description are tinted with DESCRIPTION_CRAYON. The tree is rendered through Oceananigans' own KFO show (into a buffer) so its layout is reused verbatim; we only recolor the diagnostic name, which is the header's prefix.
Oceanostics._show_diagnostic_summary — Method
Print the compact summary(op) one-liner (used when a diagnostic appears nested in a container, e.g. the NamedTuple of components a tensor returns), tinting the leading name with DESCRIPTION_CRAYON on color-capable streams — so the name matches the colored header of the multi-line show. The summary starts with name, so we recolor only that prefix and leave the rest (KernelFunctionOperation at …) untinted, exactly as the tree does.
Oceanostics.add_background_fields — Method
add_background_fields(model)
Add background fields (velocities and tracers only) to their perturbations.
Oceanostics.perturbation_fields — Method
perturbation_fields(model; kwargs...)
Remove mean fields from the model resolved fields.
Oceanostics.set_description_color! — Method
set_description_color!(c::Crayon)Configure the Crayon used to color a diagnostic's show output (the header's diagnostic name and the └── computes: … description line). Build a Crayon with Crayons.jl (using Crayons), e.g. crayon"red" or Crayon(foreground = :red).
julia> using Oceanostics, Crayons
julia> set_description_color!(crayon"magenta");
julia> DESCRIPTION_CRAYON[] == crayon"magenta"
trueOceanostics.@diagnostic_show — Macro
@diagnostic_show T name [description]Give the CustomKFO type alias T a custom display: rename its show/summary header to "<name> KernelFunctionOperation", and (when description is non-empty) append a └── computes: <description> line to its multi-line show. On color-capable streams the leading <name> and the description are tinted with DESCRIPTION_CRAYON. The header rename goes through Oceananigans' operation_name, so it also propagates (uncolored) to summary(op) and to op's appearance inside larger operation trees and Field operand lines.
Following the Julia convention, the full multi-line tree is the three-arg show (used by the REPL/display for a standalone object), while the two-arg show is the compact summary(op) one-liner with the leading <name> tinted the same DESCRIPTION_CRAYON as the tree's header. This keeps a diagnostic readable when it appears nested in a container — e.g. inside the NamedTuple of components a tensor diagnostic returns, which would otherwise print one full tree per component.