Skip to content

Commit

Permalink
fixed show stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jagoosw committed Aug 29, 2023
1 parent 63d062b commit 1721923
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
15 changes: 6 additions & 9 deletions src/Models/AdvectedPopulations/LOBSTER/LOBSTER.jl
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,12 @@ adapt_structure(to, lobster::LOBSTER) =

summary(::LOBSTER{FT, B, W}) where {FT, B, W} = string("Lodyc-DAMTP Ocean Biogeochemical Simulation Tools for Ecosystem and Resources (LOBSTER) model ($FT)")

show(model::LOBSTER{FT, Val{B}, W}) where {FT, B, W} =
string(summary(model), " \n",
" Optional components:", "\n",
" ├── Carbonates $(B[1] ? :✅ : :❌) \n",
" ├── Oxygen $(B[2] ? :✅ : :❌) \n",
" └── Variable Redfield Ratio $(B[3] ? :✅ : :❌)", "\n",
" Sinking Velocities:", "\n", show_sinking_velocities(model.sinking_velocities))

show(io::IO, model::LOBSTER) = print(io, show(model))
show(io::IO, model::LOBSTER{FT, Val{B}, W}) where {FT, B, W} = print(io, string(summary(model), " \n",
" Optional components:", "\n",
" ├── Carbonates $(B[1] ? :✅ : :❌) \n",
" ├── Oxygen $(B[2] ? :✅ : :❌) \n",
" └── Variable Redfield Ratio $(B[3] ? :✅ : :❌)", "\n",
" Sinking Velocities:", "\n", show_sinking_velocities(model.sinking_velocities)))

@inline maximum_sinking_velocity(bgc::LOBSTER) = maximum(abs, bgc.sinking_velocities.bPOM.w)

Expand Down
5 changes: 2 additions & 3 deletions src/Models/AdvectedPopulations/NPZD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ function update_boxmodel_state!(model::BoxModel{<:NPZD, <:Any, <:Any, <:Any, <:A
end

summary(::NPZD{FT, W}) where {FT, W} = string("Nutrient Phytoplankton Zooplankton Detritus model ($FT)")
show(model::NPZD) = string(summary(model), " \n",
" Sinking Velocities:", "\n", show_sinking_velocities(model.sinking_velocities))
show(io::IO, model::NPZD) = print(io, show(model))
show(io::IO, model::NPZD) = print(io, string(summary(model), " \n",
" Sinking Velocities:", "\n", show_sinking_velocities(model.sinking_velocities)))

@inline maximum_sinking_velocity(bgc::NPZD) = maximum(abs, bgc.sinking_velocities.D.w)

Expand Down
2 changes: 1 addition & 1 deletion src/OceanBioME.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Returns the redfield ratio of `tracer_name` from `bgc` when it is constant acros

summary(bgc::Biogeochemistry) = string("Biogeochemical model based on $(summary(bgc.underlying_biogeochemistry))")
show(io::IO, model::Biogeochemistry) =
print(io, show(model.underlying_biogeochemistry), " \n",
print(io, show(io, model.underlying_biogeochemistry), " \n",
" Light attenuation: ", summary(model.light_attenuation), "\n",
" Sediment: ", summary(model.sediment), "\n",
" Particles: ", summary(model.particles))
Expand Down

0 comments on commit 1721923

Please sign in to comment.