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

Allow kwargs in Options #533

Merged
merged 7 commits into from
Sep 26, 2022
Merged

Allow kwargs in Options #533

merged 7 commits into from
Sep 26, 2022

Conversation

jyu00
Copy link
Collaborator

@jyu00 jyu00 commented Sep 19, 2022

Summary

Allow users to specify arbitrary kwargs in Options. This PR also creates a new environment section for log_level, image, and instance, as an attempt to reduce the number of first level options.

Details and comments

Fixes #518

In order for auto-complete work as before, Options remains a dataclass. The new _flexible decorator dynamically creates a new dataclass with the additional fields. The new dataclass also inherits the original, so any isinstance call would continue to work.

@coveralls
Copy link

coveralls commented Sep 19, 2022

Pull Request Test Coverage Report for Build 3123362114

  • 99 of 103 (96.12%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-2.0%) to 62.207%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_ibm_runtime/qiskit_runtime_service.py 12 13 92.31%
qiskit_ibm_runtime/runtime_options.py 7 8 87.5%
qiskit_ibm_runtime/options.py 76 78 97.44%
Files with Coverage Reduction New Missed Lines %
qiskit_ibm_runtime/options.py 1 87.05%
Totals Coverage Status
Change from base Build 3100068626: -2.0%
Covered Lines: 3190
Relevant Lines: 5128

💛 - Coveralls

@jyu00 jyu00 marked this pull request as draft September 21, 2022 14:02
@jyu00 jyu00 marked this pull request as ready for review September 25, 2022 19:39
@jyu00 jyu00 requested a review from kt474 September 25, 2022 19:39
Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jyu00 jyu00 merged commit e660c8e into Qiskit:main Sep 26, 2022
@jyu00 jyu00 deleted the options-kwargs branch September 26, 2022 22:18
@jyu00 jyu00 added the Changelog: New Feature Include in the Added section of the changelog label Oct 12, 2022
@jyu00 jyu00 mentioned this pull request Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accept arbitrary options for primitives
3 participants