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

Option error refactor #2354

Closed
wants to merge 5 commits into from
Closed

Option error refactor #2354

wants to merge 5 commits into from

Conversation

philippjfr
Copy link
Member

Picks up where #2306 left off, completely refactoring option error handling. All methods of setting options will now either warn or error when given an invalid option. Could consider readding a skip option for the OptionsMagic, because that won't let you be explicit about the backend you're trying to set options on yet.

  • Update existing unit tests
  • Add new unit tests

@philippjfr
Copy link
Member Author

This is far from ready but I wanted to discuss an idea. I'd like to make option validation as strict as possible in future so you always get immediate feedback if you supplied an invalid option. By default this PR will ensure that .opts, .options and hv.opts will be strict about validation but because the magic does not yet have a way of being explicit about the backend I would not yet want that to be strict. Therefore I'd like to add two config options something like hv.config.strict_options and hv.config.strict_magics.

For testing I'd want both to be enabled, which will catch any examples that are using incorrect options.

@philippjfr
Copy link
Member Author

I also want to enable warnings when using __call__ to set options in this PR. Finally as a reminder to myself .options() without any arguments doesn't seem to be handled currently.

@philippjfr philippjfr force-pushed the option_error_refactor branch from 8d0453d to e25e348 Compare March 29, 2018 00:33
@philippjfr philippjfr closed this Nov 30, 2018
@philippjfr philippjfr reopened this Dec 19, 2018
@philippjfr philippjfr closed this Sep 22, 2019
@philippjfr philippjfr deleted the option_error_refactor branch April 25, 2022 14:43
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant