Skip to content

Commit

Permalink
Merge pull request #155 from tomchor/compathelper/new_version/2023-09…
Browse files Browse the repository at this point in the history
…-21-01-06-42-858-03230177406

CompatHelper: bump compat for Oceananigans to 0.88, (keep existing compat)
  • Loading branch information
tomchor authored Sep 22, 2023
2 parents 8a3f1bb + 77a6881 commit 1599d60
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.9.2"
manifest_format = "2.0"
project_hash = "499db9e8a647dd4085244c2217886e12b219e87a"
project_hash = "ec6ea1621ee15ad706cd9132940939cbe9c1fe63"

[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
Expand Down Expand Up @@ -474,9 +474,9 @@ version = "1.2.0"

[[deps.Oceananigans]]
deps = ["Adapt", "CUDA", "Crayons", "CubedSphere", "Dates", "Distances", "DocStringExtensions", "FFTW", "Glob", "IncompleteLU", "InteractiveUtils", "IterativeSolvers", "JLD2", "KernelAbstractions", "LinearAlgebra", "Logging", "MPI", "NCDatasets", "OffsetArrays", "OrderedCollections", "PencilArrays", "PencilFFTs", "Pkg", "Printf", "Random", "Rotations", "SeawaterPolynomials", "SparseArrays", "Statistics", "StructArrays"]
git-tree-sha1 = "20b9c143de93ef4bc4322ce5f888dcfa8113c151"
git-tree-sha1 = "1821dce5269caa6f9dc3df3e1b97928b39f233b5"
uuid = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
version = "0.87.3"
version = "0.88.0"

[[deps.OffsetArrays]]
deps = ["Adapt"]
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Oceanostics"
uuid = "d0ccf422-c8fb-49b5-a76d-74acdde946ac"
authors = ["tomchor <tomaschor@gmail.com>"]
version = "0.12.1"
version = "0.13.0"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand All @@ -10,7 +10,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[compat]
DocStringExtensions = "0.9"
Oceananigans = "0.85, 0.86, 0.87"
Oceananigans = "0.85, 0.86, 0.87, 0.88"
julia = "1.9"

[extras]
Expand Down
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Rasters = "a3a2b9e3-a471-40c9-b274-f788e487c689"

[compat]
Documenter = "1"
2 changes: 1 addition & 1 deletion docs/examples/tilted_bottom_boundary_layer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ simulation.callbacks[:wizard] = Callback(wizard, IterationInterval(4))
using Oceanostics.ProgressMessengers

walltime_per_timestep = StepDuration() # This needs to instantiated here, and not in the function below
progress(simulation) = @info (PercentageProgress(with_prefix=false, with_units=false) + Time() + TimeStep() + MaxVelocities() + AdvectiveCFLNumber() + walltime_per_timestep)(simulation)
progress(simulation) = @info (PercentageProgress(with_prefix=false, with_units=false) + SimulationTime() + TimeStep() + MaxVelocities() + AdvectiveCFLNumber() + walltime_per_timestep)(simulation)

simulation.callbacks[:progress] = Callback(progress, IterationInterval(400))

Expand Down
1 change: 0 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ makedocs(sitename = "Oceanostics.jl",
pages = pages,
modules = [Oceanostics],
doctest = true,
strict = :doctest,
clean = true,
format = format,
checkdocs = :exports
Expand Down
7 changes: 1 addition & 6 deletions src/Oceanostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,17 @@ end
#---

#+++ A few utils for closure tuples:
using Oceananigans.TurbulenceClosures: νᶜᶜᶜ, calc_nonlinear_κᶜᶜᶜ
using Oceananigans.TurbulenceClosures: νᶜᶜᶜ

# Fallbacks that capture "single closure" case
@inline _νᶜᶜᶜ(args...) = νᶜᶜᶜ(args...)
@inline _calc_nonlinear_κᶜᶜᶜ(args...) = calc_nonlinear_κᶜᶜᶜ(args...)

# End point
@inline _νᶜᶜᶜ(i, j, k, grid, closure_tuple::Tuple{}, K::Tuple{}, clock) = zero(grid)
@inline _calc_nonlinear_κᶜᶜᶜ(i, j, k, grid, closure_tuple::Tuple{}, args...) = zero(grid)

# Unroll the loop over a tuple
@inline _νᶜᶜᶜ(i, j, k, grid, closure_tuple::Tuple, K::Tuple, clock) = νᶜᶜᶜ(i, j, k, grid, closure_tuple[1], K[1], clock) +
_νᶜᶜᶜ(i, j, k, grid, closure_tuple[2:end], K[2:end], clock)

@inline _calc_nonlinear_κᶜᶜᶜ(i, j, k, grid, closure_tuple::Tuple, args...) = calc_nonlinear_κᶜᶜᶜ(i, j, k, grid, closure_tuple[1], args...) +
_calc_nonlinear_κᶜᶜᶜ(i, j, k, grid, closure_tuple[2:end], args...)
#---

include("TKEBudgetTerms.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/ProgressMessengers/ProgressMessengers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export AbstractProgressMessenger
export FunctionMessenger
export MaxUVelocity, MaxVVelocity, MaxWVelocity
export MaxVelocities
export Iteration, Time, TimeStep, PercentageProgress, Walltime, StepDuration, BasicTimeMessenger, TimeMessenger, StopwatchMessenger
export Iteration, SimulationTime, TimeStep, PercentageProgress, Walltime, StepDuration, BasicTimeMessenger, TimeMessenger, StopwatchMessenger
export MaxViscosity, AdvectiveCFLNumber, DiffusiveCFLNumber, BasicStabilityMessenger, StabilityMessenger
export CourantNumber, NormalizedMaxViscosity
export BasicMessenger, SingleLineMessenger, TimedMessenger
Expand Down
14 changes: 7 additions & 7 deletions src/ProgressMessengers/timing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ end
end
#---

#+++ Time
Base.@kwdef struct Time <: AbstractProgressMessenger
#+++ SimulationTime
Base.@kwdef struct SimulationTime <: AbstractProgressMessenger
with_prefix :: Bool = true
with_units :: Bool = true
print :: Bool = false
end

@inline function (tm::Time)(simulation)
@inline function (tm::SimulationTime)(simulation)
t = time(simulation)
message = tm.with_units ? prettytime(t) : @sprintf("%.2g", t)
tm.with_prefix && (message = "time = " * message)
Expand Down Expand Up @@ -119,10 +119,10 @@ struct BasicTimeMessenger{PM <: AbstractProgressMessenger} <: AbstractProgressMe
end

BasicTimeMessenger(; percentage = PercentageProgress(with_prefix = false, with_units = false, print = false),
time = Time(with_prefix = true, with_units = true, print = false),
Δt = TimeStep(with_prefix = true, with_units = true, print = false),
walltime = Walltime(with_prefix = true, with_units = true, print = false),
print = true) = BasicTimeMessenger{AbstractProgressMessenger}(percentage, time, Δt, walltime, print)
time = SimulationTime(with_prefix = true, with_units = true, print = false),
Δt = TimeStep(with_prefix = true, with_units = true, print = false),
walltime = Walltime(with_prefix = true, with_units = true, print = false),
print = true) = BasicTimeMessenger{AbstractProgressMessenger}(percentage, time, Δt, walltime, print)

function (stm::BasicTimeMessenger)(simulation)
message = ("["*stm.percentage*"] " * stm.time + stm.Δt + stm.walltime)(simulation)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ model_types = (NonhydrostaticModel, HydrostaticFreeSurfaceModel)
model.clock.iteration = 0
step_duration = StepDuration()
progress(simulation) = @info (PercentageProgress(with_prefix=false, with_units=false)
+ Time() + TimeStep() + MaxVelocities()
+ SimulationTime() + TimeStep() + MaxVelocities()
+ AdvectiveCFLNumber() + step_duration)(simulation)
test_progress_messenger(model, progress)
end
Expand Down

2 comments on commit 1599d60

@tomchor
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/91992

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.13.0 -m "<description of version>" 1599d6091025fa1cae49639f6d3b1ce39bd809d6
git push origin v0.13.0

Please sign in to comment.