forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecating Provider ABC, as abstraction is not very useful (Qiskit#1…
…2145) * Provider abstraction is not very useful * udpate docs * ignore deprecations * not triggered on CI * deprecation warnings in visual tests * set up * set up without warning? * setUpClass * more test adjust * raise at setUpClass * warms * test_circuit_matplotlib_drawer.py * skip Aer warning * Apply suggestions from code review Co-authored-by: Matthew Treinish <[email protected]> * reno * Run black * Update release note * linter --------- Co-authored-by: Matthew Treinish <[email protected]>
- Loading branch information
Showing
10 changed files
with
78 additions
and
32 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
18 changes: 18 additions & 0 deletions
18
releasenotes/notes/deprecate_providerV1-ba17d7b4639d1cc5.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
deprecations_providers: | ||
- | | ||
The abstract base classes ``Provider`` and ``ProviderV1`` are now deprecated and will be removed in Qiskit 2.0.0. | ||
The abstraction provided by these interface definitions were not providing a huge value. solely just the attributes | ||
``name``, ``backends``, and a ``get_backend()``. A _provider_, as a concept, will continue existing as a collection | ||
of backends. If you're implementing a provider currently you can adjust your | ||
code by simply removing ``ProviderV1`` as the parent class of your | ||
implementation. As part of this you probably would want to add an | ||
implementation of ``get_backend`` for backwards compatibility. For example:: | ||
def get_backend(self, name=None, **kwargs): | ||
backend = self.backends(name, **kwargs) | ||
if len(backends) > 1: | ||
raise QiskitBackendNotFoundError("More than one backend matches the criteria") | ||
if not backends: | ||
raise QiskitBackendNotFoundError("No backend matches the criteria") | ||
return backends[0] |
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