euro-hpc-pl / SpinGlassEngine.jl

Apache License 2.0
1 stars 1 forks source link

Improve constructor readability by using keyword arguments #26

Closed annamariadziubyna closed 1 month ago

annamariadziubyna commented 1 month ago

The current constructors for classes such as MpsParameters and SearchParameters etc. utilize positional arguments. Can we use kwargs instead? This will improve readability and usability.

lpawela commented 1 month ago

Is this what you need? https://github.com/euro-hpc-pl/SpinGlassEngine.jl/tree/lp/kwarg-constructors

annamariadziubyna commented 1 month ago

Yes, this is exactly what we need.

lpawela commented 1 month ago

Any others or only these two types?

annamariadziubyna commented 1 month ago

Yes, in addition to MpsParameters and SearchParameters, we also want to refactor two other components: MpsContractor and merge_branches. For the MpsContractor{T,R,S}( net, βs::Vector{S}, graduate_truncation::Symbol, params; onGPU = true, depth::Int = 0, ), we suggest keeping net and params as positional arguments, but passing the rest through keyword arguments. For the function merge_branches( ctr::MpsContractor{T}, merge_type::Symbol = :nofit, update_droplets = NoDroplets(), ), we propose that ctr remains as a positional argument, while the rest should be passed through keyword arguments.