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

Specify service parameter channel through env variable #452

Merged
merged 4 commits into from
Aug 4, 2022

Conversation

kt474
Copy link
Member

@kt474 kt474 commented Aug 1, 2022

Summary

channel can now be stored as an environment variable so the service does not have to be instantiated manually and instead can be created from the env variables.

Example:

from qiskit_ibm_runtime import Sampler
import os

os.environ["QISKIT_IBM_CHANNEL"] = channel
os.environ["QISKIT_IBM_TOKEN"] = token
os.environ["QISKIT_IBM_INSTANCE"] = instance
os.environ["QISKIT_IBM_URL"] = url

with Sampler(...) as sampler:
    result = sampler(...)

Details and comments

Fixes #444

@coveralls
Copy link

coveralls commented Aug 1, 2022

Pull Request Test Coverage Report for Build 2798709559

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 62.635%

Totals Coverage Status
Change from base Build 2798688893: 0.2%
Covered Lines: 2895
Relevant Lines: 4622

💛 - Coveralls

@kt474 kt474 changed the title [WIP] Specify service parameter channel through env variable Specify service parameter channel through env variable Aug 2, 2022
@rathishcholarajan rathishcholarajan merged commit 8f641a3 into Qiskit:main Aug 4, 2022
@jyu00 jyu00 added the Changelog: New Feature Include in the Added section of the changelog label Oct 12, 2022
@kt474 kt474 deleted the parameterize-service-arguments branch July 13, 2023 21:48
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.

Add ability for all QiskitRuntimeService constructor arguments be specified through env variables.
4 participants