open-AIMS / ADRIA.jl

ADRIA: Adaptive Dynamic Reef Intervention Algorithms. A multi-criteria decision support platform for informing reef restoration and adaptation interventions.
MIT License
14 stars 5 forks source link

Metadata not retained after switching RCP datasets #794

Open ConnectedSystems opened 2 months ago

ConnectedSystems commented 2 months ago

Environmental datasets do not retain metadata after switch.

julia> dom = ADRIA.load_domain("<path to domain>")
julia> dom2 = ADRIA.switch_RCPs!(dom, "45")

julia> dom.dhw_scens[timesteps=At(2025)]
╭────────────────────────────╮
│ 334×50 YAXArray{Float32,2} │
├────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── dims ┐
  ↓ sites     Categorical{String} [Briggs_16074_Crest_1, Briggs_16074_Outer Flat_1a, …, Thetford_16068_Slope_9a, Thetford_16068_Slope_9b] ForwardOrdered,
  → scenarios Sampled{Int64} 1:50 ForwardOrdered Regular Points
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── metadata ┤
  Dict{String, Any}()
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── file size ┤
  file size: 65.23 KB
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

julia> dom2.dhw_scens[timesteps=At(2025)]
ERROR: ArgumentError: 2025 for not found in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75]