Skip to content

Commit

Permalink
Fix coral_cover and full_coral_cover factory names that were switched
Browse files Browse the repository at this point in the history
  • Loading branch information
Zapiano committed Sep 13, 2024
1 parent f7742dd commit 34d070a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions test/factories/coral_cover.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
using ADRIA: YAXArray, DataCube, ZeroDataCube

"""Raw model coral cover results, proportional to k-area."""
function coral_cover(
function coral_cover(;
n_timesteps::Int64=10,
n_group_sizes::Int64=35,
n_locations::Int64=5,
n_scenarios::Int64=32
)::YAXArray{Float64,4}
coral_cover = Factories.full_coral_cover(;
n_timesteps, n_group_sizes, n_locations, n_scenarios
)

location_weights::Array{Float64,4} = repeat(
rand(n_timesteps, n_locations, n_scenarios), 1, 1, 1, n_group_sizes
)

return coral_cover .* permutedims(location_weights, [1, 4, 2, 3])
end

"""Cover for each location at each timestep and scenario sums up to 1."""
function full_coral_cover(
;
n_timesteps::Int64=10,
n_group_sizes::Int64=35,
Expand All @@ -27,24 +45,6 @@ function coral_cover(
return DataCube(cover_data, (:timesteps, :species, :locations, :scenarios))
end

"""Cover for each location at each timestep and scenario sums up to 1."""
function full_coral_cover(;
n_timesteps::Int64=10,
n_group_sizes::Int64=35,
n_locations::Int64=5,
n_scenarios::Int64=32
)::YAXArray{Float64,4}
coral_cover = Factories.coral_cover(;
n_timesteps, n_group_sizes, n_locations, n_scenarios
)

location_weights::Array{Float64,4} = repeat(
rand(n_timesteps, n_locations, n_scenarios), 1, 1, 1, n_group_sizes
)

return coral_cover .* permutedims(location_weights, [1, 4, 2, 3])
end

"""Cover for all timesteps, locations and scenarios is zero"""
function zero_coral_cover(
;
Expand Down

0 comments on commit 34d070a

Please sign in to comment.