artofscience / SAOR

Sequential Approximate Optimization Repository
GNU General Public License v3.0
5 stars 1 forks source link

Collect mma options in dataclass #100

Closed MaxvdKolk closed 2 years ago

MaxvdKolk commented 2 years ago

This combines the MMA-related options in a single dataclass. This helps in reducing the large number of optional keyword arguments for some of the MMA functions. Additionally, this makes sure there is only one definition for the default values (i.e. in the MMAOptions definition) rather than possible duplications inside function definitions.

Functions can accept options=MMAOptions() which initialises all options to default values. As as user, you can then provide alternative settings as options=MMAOptions(asyinit=value, asydecr=value) etc.

Maybe @Giannis1993 or @artofscience can update the documentation to better reflect their interpretation.

MaxvdKolk commented 2 years ago

Looking good! I am wondering though if it makes sense to use such an options= argument in all classes that can be defined using different options. What do you guys think?

It might be nice to do so, although when there are only a "couple" options it might add more complexity. Not exactly sure if there is a guideline for when a "couple" becomes too many though.

MaxvdKolk commented 2 years ago

The docstring is resolved @artofscience.