qiskit.providers.models.backendstatus의 소스 코드

# This code is part of Qiskit.
# (C) Copyright IBM 2020.
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Class for backend status."""

from qiskit.exceptions import QiskitError

[문서]class BackendStatus: """Class representing Backend Status."""
[문서] def __init__(self, backend_name, backend_version, operational, pending_jobs, status_msg): """Initialize a BackendStatus object Args: backend_name (str): The backend's name backend_version (str): The backend's version of the form X.Y.Z operational (bool): True if the backend is operational pending_jobs (int): The number of pending jobs on the backend status_msg (str): The status msg for the backend Raises: QiskitError: If the backend version is in an invalid format """ self.backend_name = backend_name self.backend_version = backend_version self.operational = operational if pending_jobs < 0: raise QiskitError('Pending jobs must be >=0') self.pending_jobs = pending_jobs self.status_msg = status_msg
[문서] @classmethod def from_dict(cls, data): """Create a new BackendStatus object from a dictionary. Args: data (dict): A dictionary representing the BaseBakend to create. It will be in the same format as output by :func:`to_dict`. Returns: BackendStatus: The BackendStatus from the input dictionary. """ return cls(**data)
[문서] def to_dict(self): """Return a dictionary format representation of the BackendStatus. Returns: dict: The dictionary form of the QobjHeader. """ return self.__dict__
def __eq__(self, other): if isinstance(other, BackendStatus): if self.__dict__ == other.__dict__: return True return False

© Copyright 2020, Qiskit Development Team. 최종 업데이트: 2021/01/17

Built with Sphinx using a theme provided by Read the Docs.
당신은 다음 언어로 문서를 보고 있다 lang: Korean