Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproduce comments in config .toml file #125

Open
drewoldag opened this issue Dec 2, 2024 · 0 comments
Open

Reproduce comments in config .toml file #125

drewoldag opened this issue Dec 2, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@drewoldag
Copy link
Collaborator

drewoldag commented Dec 2, 2024

Currently when we produce the finalized config file (comprised of the fibad default + external library default + user specific configs) all of the comments in the original config files are lost.

We should maintain these comments as much as possible. We currently use the toml package for parsing and outputting the config files, but it doesn't maintain the comments. A package like TOMLKit https://tomlkit.readthedocs.io/en/latest/ will maintain the comments and create a config dictionary that we can use without modifying the rest of fibad.

Aside from maintaining comments and making it easier for a user to understand the values in a finalized config, this would also open the door to allowing users in an interactive session to leave notes for why they chose specific values for a given run.
i.e. (api subject to change)

fibad_instance = Fibad(config_file='./my_config.toml')
fibad_instance.config['train']['epochs']=100
fibad_instance.config['train']['epochs'].note('Running for more to see if loss improves')

Additionally, we could over ride the repr methods such that toml tables and keys could be printed in an interactive session with a representation similar to a docstring.
i.e.

fibad_instance = Fibad(config_file='./my_config.toml')
fibad_instance.config['train']['epochs'].help()

train
    epochs = 10
        "The number of times the model will see of the training dataset samples."

fibad_instance.config['general'].help()

general
    dev_mode = False
        Whether to run in development mode....
    log_destination = stderr
         Destination of log messages.
    data_dir = ./data/
        Output location for downloaded data....
@drewoldag drewoldag added the enhancement New feature or request label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant