Skip to content

Fix doc previews #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,27 @@ for file in files
rm(file)
end

withenv("GITHUB_REPOSITORY" => "FourierFlows/FourierFlowsDocumentation") do
deploydocs(
repo = "github.com/FourierFlows/FourierFlowsDocumentation.git",
versions = ["stable" => "v^", "v#.#.#", "dev" => "dev"],
forcepush = true,
push_preview = true,
devbranch = "main"
)
# Replace with below once https://github.com/JuliaDocs/Documenter.jl/pull/2692 is merged and available.
# deploydocs(repo = "github.com/FourierFlows/FourierFlows.jl",
# deploy_repo = "github.com/FourierFlows/FourierFlowsDocumentation",
# devbranch = "main",
# forcepush = true,
# push_preview = true,
# versions = ["stable" => "v^", "dev" => "dev", "v#.#.#"])

if get(ENV, "GITHUB_EVENT_NAME", "") == "pull_request"
deploydocs(repo = "github.com/FourierFlows/FourierFlows.jl",
repo_previews = "github.com/FourierFlows/FourierFlowsDocumentation",
devbranch = "main",
forcepush = true,
push_preview = true,
versions = ["stable" => "v^", "dev" => "dev", "v#.#.#"])
else
repo = "github.com/FourierFlows/FourierFlowsDocumentation"
withenv("GITHUB_REPOSITORY" => repo) do
deploydocs(; repo,
devbranch = "main",
versions = ["stable" => "v^", "dev" => "dev", "v#.#.#"],
forcepush = true)
end
end
20 changes: 10 additions & 10 deletions test/test_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ end
function testdealias(grid::ThreeDGrid)
fh = ones(Complex{eltype(grid)}, size(grid.Krsq))
dealias!(fh, grid)

kmax = round(maximum(grid.kr)*2/3)
lmax = round(maximum(abs.(grid.l))*2/3)
mmax = round(maximum(abs.(grid.m))*2/3)
Expand All @@ -128,7 +128,7 @@ function testdealias(grid::ThreeDGrid)
fh[i₁, i₂, i₃] = 0
end
end

return isapprox(sum(abs.(fh)), 0)
end

Expand All @@ -152,13 +152,13 @@ end

function testtypedtwodgrid(dev::Device, nx, Lx, ny=Lx, Ly=Lx; T=Float64)
grid = TwoDGrid(; nx, Lx, ny, Ly, T)

return typeof(grid.dx)==T && typeof(grid.dy)==T && typeof(grid.x[1])==T && typeof(grid.y[1])==T && typeof(grid.Lx)==T && typeof(grid.Ly)==T && eltype(grid) == T
end

function testtypedthreedgrid(dev::Device, nx, Lx, ny=nx, Ly=Lx, nz=nx, Lz=Lx; T=Float64)
grid = ThreeDGrid(; nx, Lx, ny, Ly, nz, Lz, T)

return typeof(grid.dx)==T && typeof(grid.dy)==T && typeof(grid.dz)==T && typeof(grid.x[1])==T && typeof(grid.y[1])==T && typeof(grid.z[1])==T && typeof(grid.Lx)==T && typeof(grid.Ly)==T && typeof(grid.Lz)==T && eltype(grid) == T
end

Expand Down Expand Up @@ -190,13 +190,13 @@ function test_plan_flows_fftrfft(::GPU; T=Float64)

region_ans = VERSION >= v"1.9.0" ? (1, 2) : [1, 2]

return typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4,))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 1} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 2} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6, 8))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 3} &&
return typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4,))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 1, 1, Nothing} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 2, 2, Nothing} &&
typeof(FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6, 8))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, Complex{T}, -1, false, 3, 3, Nothing} &&
FourierFlows.plan_flows_fft(A(rand(Complex{T}, (4, 6, 8))), [1, 2]).region == region_ans &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4,))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 1} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 2} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6, 8))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 3} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4,))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 1, 1, CuArray{Complex{T}, 1, CUDA.DeviceMemory}} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 2, 2, CuArray{Complex{T}, 2, CUDA.DeviceMemory}} &&
typeof(FourierFlows.plan_flows_rfft(A(rand(T, (4, 6, 8))))) == CUDA.CUFFT.CuFFTPlan{Complex{T}, T, -1, false, 3, 3, CuArray{Complex{T}, 3, CUDA.DeviceMemory}} &&
FourierFlows.plan_flows_rfft(A(rand(T, (4, 6, 8))), [1, 2]).region == region_ans
end

Expand Down
Loading