-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add user config file for local settings #2122
Conversation
This commit adds the concept of a user config file to set local defaults when using qiskit-terra. This enables the end user to override the default values for some commonly used terra functions in their local environment. Right now this only includes the backend used by the circuit drawer, but it will be expanded in the future as more settings with opinionated defaults are exposed. To set a config file you can either create one in the default location '~/.config/qiskit/settings.conf' or use the QISKIT_SETTINGS environment variable to specify an alternative location.
Why is this not in the .qiskit dir and why are we not taking advantage of the runtime config stuff we already have? |
It's a typo/mistake in the commit message, I copied the directory from the ibmq provider code and just changed the file name. The directory is The reason It's not using the same file is after looking at the same qiskitrc is that the way the ibmq provider parses that is it uses any section name as a different set of credentials. So adding anything to it will be interpreted as a new set of credentials. Instead of trying to change the contract there it felt better to just make it a distinct file. |
Yes, it is unfortunate that that design choice was made. I was mentioning reusing the runtime config functionally we already have, but I think they were moved out of terra to the provider, so that answers that question. |
Ah that's what you were asking about, yeah that was moved out of the repo with the split of the qiskit-ibmq-provider: https://github.com/Qiskit/qiskit-ibmq-provider/blob/master/qiskit/providers/ibmq/credentials/configrc.py |
Since I can't figure out a reliable way to mock open on python 3.5 and 3.6 (it works fine on 3.7) this commit just skips the tests that used to use tempfile and sets them to skip on windows environments, since they don't work on appveyor.
In Qiskit/qiskit#2122 a new feature was added for having user config files that let local environments override some default settings for functions in terra. Right now this is just the circuit drawer backend, but this will grow in the future. This commit adds documentation on how to use this feature.
In Qiskit/qiskit#2122 a new feature was added for having user config files that let local environments override some default settings for functions in terra. Right now this is just the circuit drawer backend, but this will grow in the future. This commit adds documentation on how to use this feature.
* Add user config file for local settings This commit adds the concept of a user config file to set local defaults when using qiskit-terra. This enables the end user to override the default values for some commonly used terra functions in their local environment. Right now this only includes the backend used by the circuit drawer, but it will be expanded in the future as more settings with opinionated defaults are exposed. To set a config file you can either create one in the default location '~/.config/qiskit/settings.conf' or use the QISKIT_SETTINGS environment variable to specify an alternative location. * Updates * Fix lint issues * Fix tests on windows * Fix lint * Try to fix tests on python <3.7 * More testing updates * Fix lint * Skip tempfile tests on windows Since I can't figure out a reliable way to mock open on python 3.5 and 3.6 (it works fine on 3.7) this commit just skips the tests that used to use tempfile and sets them to skip on windows environments, since they don't work on appveyor. * Remove unused import
Summary
This commit adds the concept of a user config file to set local defaults
when using qiskit-terra. This enables the end user to override the
default values for some commonly used terra functions in their local
environment. Right now this only includes the backend used by the
circuit drawer, but it will be expanded in the future as more settings
with opinionated defaults are exposed. To set a config file you can
either create one in the default location
'~/.config/qiskit/settings.conf' or use the QISKIT_SETTINGS environment
variable to specify an alternative location.
Details and comments