-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unregister() via DefaultQISKitProvider changes (#584)
* Add unregister() via DefaultQISKitProvider changes Add `wrapper.unregister()` for removing previously registered providers, by delegating into `DefaultQISKitProvider` internal tracking of provider instances: * use a dict instead of a list for `self.providers`, introducing the ability to assign a user name to a provider instance at the wrapper level. * update `register(...,provider_name)` parameter so it is set by the user explicitly (with "weak" fallbacks for the two main use cases, for backwards compatibility). * add `wrapper.registered_providers()` for convenience, displaying the list of currently registered providers. Regroup wrapper tests, adding basic ones for the new functionality and fixing an issue with global variables and imports via `tearDown`. * Fixes wrapper unregister and tests after review * Revise docstrings with reference to user-provided name. * Make tests more robust. * Misc fixes. * Add warning if backend name clash when registering Add a check during backend registration that prints a warning if a backend name clash is detected. * Polishing names and improving tests. Test now check if, after registering a provider with colliding backend names, an specific backend name still refers to that available before registering the provider.
- Loading branch information
1 parent
f7cc839
commit e51b4fd
Showing
10 changed files
with
258 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.