How can I merge two YAXarrays datasets

I’ve created two YAXArrays from data stored in two separate groups of an HDF5 file.
They share the same dimensions, and I’d like to merge them into a single Dataset.

Is there a recommended way to do this?
I couldn’t find any documentation on combining multiple datasets in YAXArrays.jl.

I tried creating a dictionary to combine the two datasets and then converting it back into a Dataset, but I wasn’t successful — mainly because I’m not sure how to iterate over the variables in a Dataset.

function merge_datasets(ds_list::Vector{Dataset})
    datasets = Dict{Symbol, YAXArray}()

    for ds in ds_list
        for name in Variables(ds)
            datasets[name] = ds[name]
        end
    end

    return Dataset(; properties = Dict{String, Any}(), datasets...)
end

You are right, there is currently no good documented way to loop over the elements of a Dataset. My quick solution would be this one:

using YAXArrays
dataset1 = Dataset(a = YAXArray((lon(1:10),lat(1:5)),zeros(10,5)))
dataset2 = Dataset(b = YAXArray((lon(1:10),lat(1:5)),zeros(10,5)))

Dataset(;dataset1.cubes...,dataset2.cubes...)

Thank you for your help. I have another question. In Python’s xarray, you can create a new variable inside a Dataset using:

dataset["c"] = dataset["a"] ** 2

How can I do the equivalent in Julia using YAXArrays.jl ? or I need to do:
ds = Dataset(; ds.cubes..., c =ds["a"].^2)? It doesn’t feel natural.