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

Ignore superfluous options in INI #335

Closed
Binero opened this issue Oct 23, 2019 · 4 comments · Fixed by #362
Closed

Ignore superfluous options in INI #335

Binero opened this issue Oct 23, 2019 · 4 comments · Fixed by #362

Comments

@Binero
Copy link

Binero commented Oct 23, 2019

I don't think there currently is a way to ignore superfluous options in an INI file, that is options that are set within the INI, but are not used by the program.

Use case:

I am writing an image encoder/decoder combo, which both have slightly different option requirements, but it would be useful if they could use the same INI files.

@henryiii
Copy link
Collaborator

That's a good idea, infact, I'm thinking that should actually be the default. Thoughts?

I've been traveling quite a bit recently (PyHEP 2019), but things will settle down in 2-3 weeks (after CHEP 2019). Pretty much working full time on boost-histogram before CHEP...

@Binero
Copy link
Author

Binero commented Oct 23, 2019

I might be able to look into this, but I'm curious as to what kind of API we'd use to set this. The most straightforward way (and backwards compatible way) would be to just tuck an extra bool at the end of set_config whether to ignore superfluous options, but that might not be the most elegant solution.

@phlptp
Copy link
Collaborator

phlptp commented Oct 25, 2019

There is a flag in app allow_config_extras_ I would suggest that if that is true extra fields in the ini file should be ignored. right now it seems coupled to allow_extras, but I think it might make sense to decouple them and have allow_confix_extras_ to default to true and be set independently of allow_extras

@phlptp
Copy link
Collaborator

phlptp commented Oct 25, 2019

On a related note, I have been wanting to figure out how to not have the configuration file check throw an exception if the default file isn't there and the config isn't required, so I will probably be working on that aspect in the next couple weeks, since I would like that for our application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants