Add the ability to use a toml file as input. #10
Add the ability to use a toml file as input. #10joanimato wants to merge 4 commits intoforlilab:developfrom
Conversation
diogomart
left a comment
There was a problem hiding this comment.
Thanks for this feature, I think it's useful. I have two comments:
- It looks easy to add bugs if we add options in the future to argparse and forget to update the list of expected keywords in the override function, which is in a different file.
- If we have a typo in an option in toml there is no error, it fails silently. It should error.
Similar functionality is implemented in meeko's mk_prepare_ligand.py, by setting the defaults of argparse based on the configuration file. This happens here:
https://github.com/forlilab/Meeko/blob/07a38f8bac4aa9eef4ef30aa8e67475b15d517aa/meeko/cli/mk_prepare_ligand.py#L276
and the defaults that are used for options that are passed neither in the config file or through argparse are read directly from the class:
https://github.com/forlilab/Meeko/blob/07a38f8bac4aa9eef4ef30aa8e67475b15d517aa/meeko/cli/mk_prepare_ligand.py#L50
Do you think that would make sense here?
|
Sounds good, I will make the modifications. |
|
The new commit should address your issues. I did not want to make any major modifications just yet. We can decide any major regactors (as well as adding a test suite) later. |
|
Hi, in my opinion, instead of using To take advantage of it, you only need to add this argument at the end of all add_argument. |
|
That's an interesting package. Will look into it. Thanks! |
This PR adds the option to use a .toml file as an input file. The .toml file can store command line options for reproducibility. For example, instead of running
you can create a
input.tomlfile with the following options:and then run
scrub.py input.toml. This makes it easier to create reproducible runs when testing the software. The toml input also allows the user to input multiple SMILES strings (similar to a .smi file).CLI options can still be passed to the script and will override anything that's in the toml file.