resultwizard / ResultWizard

Intelligent interface between Python-computed values and your LaTeX work.
https://resultwizard.github.io/ResultWizard
MIT License
7 stars 0 forks source link

Reset a config setting to default value #36

Open Splines opened 7 months ago

Splines commented 7 months ago

Imagine the scenario when a user sets a config setting, e.g.

wiz.config(decimal_places=2)

Later on, the users wants to reset this config to the default value. Right now, they would have to lookup the default value which is -1 for decimal_places. Setting wiz.config(decimal_places=None) will result in unintended behavior.

To avoid this, we should provide something like:

wiz.reset("decimal_places")

String values could be stored in an enum so that we get IntelliSense. These values should be kept in sync with config_init and config.

Splines commented 7 months ago

only allow positive values for decimal_places

Splines commented 7 months ago

idea: wiz.config.decimal_places.set(2) and wiz.config.decimal_places.reset()

Splines commented 2 months ago

New API proposals can be found in this comment.