I don’t see how that could be done with named tuples readily.
I thought that @with_kw and @unpack worked with named tuples as well. Using a bit of code from the Parameters.jl site and expanding on it:
julia> using Parameters
julia> MyNT = @with_kw (x = 1, y = "foo", z = :(bar))
##NamedTuple_kw#263 (generic function with 2 methods)
julia> tupl1 = MyNT(x=2)
(x = 2, y = "foo", z = :bar)
julia> @unpack x=tupl1
(x = 2, y = "foo", z = :bar)
julia> x
2
In this case, you can use a mutable struct or, more likely, store arrays in the struct, and just calibrate the parameters that are defined in these arrays, that mutable anyway, even if the struct is not mutable (this would be the same for a named tuple containing an array):
I was reading here that immutable types have significant performance advantages and that using Setfield.jl to modify them has performance advantages compared to using mutables. Not sure whether those advantages hold when you store arrays in an immutable struct and then alter those arrays. But that seems like more hoops to jump through than just using Setfield.jl, particularly since many of the elements in the parameters container would be of the form: alpha=0.5, beta=0.9, nk=50 , etc.
Right now I’m leaning a bit towards named tuples because of the fact that they are type inferred and I therefore would not need to explicitly set out the type of each parameter.