Skip to content

Commit

Permalink
Merge branch 'main' into job_properties
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Oct 5, 2023
2 parents e0e037c + 614cace commit a38733a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
5 changes: 3 additions & 2 deletions qiskit_ibm_provider/qpy/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

"""Exception for errors raised by the pulse module."""
from typing import Any
from qiskit.exceptions import QiskitError
from qiskit.qpy.exceptions import QpyError
from ..exceptions import IBMError


class QpyError(QiskitError):
class IBMQpyError(QpyError, IBMError):
"""Errors raised by the qpy module."""

def __init__(self, *message: Any):
Expand Down
8 changes: 1 addition & 7 deletions qiskit_ibm_provider/visualization/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@

"""Exceptions related to the visualization modules."""

from ..exceptions import IBMError


class VisualizationError(IBMError):
"""Base class for errors raised by the visualization modules."""

pass
from qiskit.visualization.exceptions import VisualizationError


class VisualizationValueError(VisualizationError, ValueError):
Expand Down
7 changes: 4 additions & 3 deletions test/unit/mock/fake_account_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import List, Dict, Any, Optional

from qiskit.providers.fake_provider.backends.lima.fake_lima import FakeLima
from qiskit.providers.exceptions import QiskitBackendNotFoundError


class FakeApiBackend:
Expand Down Expand Up @@ -81,7 +82,7 @@ def backend_status(self, backend_name: str) -> Dict[str, Any]:
for back in self._backends:
if back.name == backend_name:
return back.status.copy()
raise ValueError(f"Backend {backend_name} not found")
raise QiskitBackendNotFoundError(f"Backend {backend_name} not found")

def backend_properties(
self, backend_name: str, datetime: Optional[python_datetime] = None
Expand All @@ -91,14 +92,14 @@ def backend_properties(
for back in self._backends:
if back.name == backend_name:
return back.properties.copy()
raise ValueError(f"Backend {backend_name} not found")
raise QiskitBackendNotFoundError(f"Backend {backend_name} not found")

def backend_pulse_defaults(self, backend_name: str) -> Dict:
"""Return the pulse defaults of the backend."""
for back in self._backends:
if back.name == backend_name:
return back.defaults.copy()
raise ValueError(f"Backend {backend_name} not found")
raise QiskitBackendNotFoundError(f"Backend {backend_name} not found")

# Test-only methods.

Expand Down

0 comments on commit a38733a

Please sign in to comment.