-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove deprecated BackendV1
elements, including base class, providers.models
and qobj
modules
#13793
Conversation
qobj
, pulse
module, and related tools from BackendV1
BackendV1
elements, including base class, providers.models
and qobj
modules
Pull Request Test Coverage Report for Build 13684630517Details
💛 - Coveralls |
BackendV1
elements, including base class, providers.models
and qobj
modulesBackendV1
elements, including base class, providers.models
and qobj
modules
One or more of the following people are relevant to this code:
|
Oops, just another qiskit/qiskit/providers/__init__.py Line 606 in 1eb8e5b
|
…into macro-removal
… Remove json decoding utils that weren't part of the public API and flew under the radar in the Fake Backend removal PR.
class MeasReturnType(str, Enum): | ||
"""PulseQobjConfig meas_return allowed values.""" | ||
|
||
AVERAGE = "avg" | ||
SINGLE = "single" | ||
|
||
|
||
class MeasLevel(IntEnum): | ||
"""MeasLevel allowed values.""" | ||
|
||
RAW = 0 | ||
KERNELED = 1 | ||
CLASSIFIED = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will a warning about the move of these get into 1.4? It might be worth importing these back here from the new location, maybe with a module level __getattr__
to warn about the move since it is close to 2.0 and these are referenced in other packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment was made assuming MeasLevel
and MeasReturnType
were still public but I see now that they are in qiskit.result.model
and not added to the docs. Are they not intended to be public any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I see. I wasn't aware of the external use of these classes, I treated them as an internal migration. They were not part of the docs, not even in the original location, and they were buried among other outdated utilities so I didn't think they would be used externally. Now taking a closer look, they were probably intended to be public even though they technically weren't. Thanks for pointing this out @wshanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 27c2c63. I added a note specifying the old and new import paths. As for the deprecation warning, it was discussed internally and it is not in scope for an internal API. For external devs, the reno should contain the migration info. For IBM internal devs, I can help migrate. So far I have seen qiskit-experiments
and qiskit-ibm-runtime
importing these classes, let me know if you are aware of others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ElePT! I missed the fact that this was always internal before with my previous messages 🤦♂️ With the commit you mentioned, you added these classes to qiskit.result
but didn't add them to the docs. Will they still be considered private going forward?
I checked qiskit-experiments' usage and it only uses =
and ==
with the enum members so I think we could redefine the enums internally if necessary. I was a little worried about some of the other enum features like in
where using two definitions of the enum might not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I confirmed that they will stay private. I think that vendoring them in qiskit-experiments
would be a good idea moving forward.
…55) BackendV1 and qiskit.qobj removals in Qiskit/qiskit#13793 cause the test in qiskit_neko/tests/experiments/test_tomography.py to fail. This is part of the tests that are blocking the Qiskit/qiskit#13793 and Qiskit/qiskit#13872 PR in Qiskit from being merged. There is a PR in Qiskit Experiments that address these removals: qiskit-community/qiskit-experiments#1526. Until it is merged, we need to skip this failing test. Tracked in #54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this LGTM. Thanks for doing this! This finally finishes a process I started back in 2019 with #3383 of trying to clean up these interfaces. I'm glad to see that 4 years later we're finally able to remove this legacy code from Qiskit. This is incredibly satisfying to see.
I just had a couple small comments inline. I thinkt he only one that needs an update is the release notes one though.
@@ -21,7 +21,7 @@ | |||
provider is anything that provides an external service to Qiskit. The typical | |||
example of this is a Backend provider which provides | |||
:class:`~qiskit.providers.Backend` objects which can be used for executing | |||
:class:`~qiskit.circuit.QuantumCircuit` and/or :class:`~qiskit.pulse.Schedule` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR doesn't remove schedules yet but it's fine. :)
If migrating a provider from :class:`~qiskit.providers.BackendV1` | ||
one thing to keep in mind is for | ||
backwards compatibility you might need to add a configuration method that | ||
will build a :class:`~qiskit.providers.models.BackendConfiguration` object | ||
and :class:`~qiskit.providers.models.BackendProperties` from the attributes | ||
defined in this class for backwards compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have left this comment in the docstring because someone could conceivably be migrating from BackendV1
post removal (as part of fixing 2.0 compatibility). But it also is fine to remove it since this lives in the 1.4 docs.
@@ -138,7 +138,7 @@ def draw(self, renderer): | |||
|
|||
class Bloch: | |||
"""Class for plotting data on the Bloch sphere. Valid data can be | |||
either points, vectors, or qobj objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, what!? There is nothing that ever took a qobj here afaik.
The ``BackendV1`` model has been removed following its deprecation in | ||
Qiskit 1.2.0. This includes the ``BackendV1`` class as well as related | ||
modules and utils, as they have been superseded by the :class:`.BackendV2` | ||
model. The list of removed items includes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to mention this also includes things that previously could accept a backend v1 object like generate_preset_pass_manager
etc.
legacy ``BackendV1`` components (such as ``BackendConfiguration`` or ``BackendProperties``) | ||
|
||
* ``BackendPropertyError`` and ``BackendConfigurationError``: exceptions linked to removed classes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are a couple of removals missing here. The ones I caught are:
Target.from_configuration()
backend_properties` argtarget_to_backend_properties
I might have missed others though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the quick update.
Summary
This PR builds upon (
and is BLOCKED BY) the changes in #13805.This PR removes
BackendV1
and all related modules and utils. This includes:from
qiskit/providers
:BackendV1
BackendV2Converter
convert_to_target
BackendPropertyError
BackendConfigurationError
from
qiskit/providers/models
: these were BackendV1 data structures. Full module removedBackendConfiguration
BackendProperties
BackendStatus
QasmBackendConfiguration
PulseBackendConfiguration
UchannelLO
GateConfig
PulseDefaults
Command
JobStatus
GateProperties
Nduv
Removed
PulseQobjDef
fromqiskit/providers/models
(this steps a bit into pulse removal realm)from
qiskit/qobj
: Full module removed.Note that there were two classes defined in the qobj utils (
MeasLevel
andMeasReturnType
) used in the result class, so they have been moved toresult/models.py
.TODOs
Details