Skip to content

Commit 7340ff1

Browse files
kt474ElePT
andauthored
Minor docstring updates (#2418)
* Minor docstring updates * Update qiskit_ibm_runtime/session.py Co-authored-by: Elena Peña Tapia <[email protected]> --------- Co-authored-by: Elena Peña Tapia <[email protected]>
1 parent 0e8f867 commit 7340ff1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

qiskit_ibm_runtime/qiskit_runtime_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ def backends(
561561
# Get the backends that support OpenPulse
562562
QiskitRuntimeService.backends(open_pulse=True)
563563
564-
For the full list of backend attributes, see the `IBMBackend` class documentation
565-
<https://quantum.cloud.ibm.com/docs/api/qiskit/1.4/providers_models>
564+
For the full list of backend attributes, see the `IBMBackend class documentation
565+
<https://quantum.cloud.ibm.com/docs/api/qiskit-ibm-runtime>`_
566566
567567
Returns:
568568
The list of available backends that match the filter.

qiskit_ibm_runtime/session.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,16 @@ def service(self) -> QiskitRuntimeService:
319319

320320
@classmethod
321321
def from_id(cls, session_id: str, service: QiskitRuntimeService) -> "Session":
322-
"""Construct a Session object with a given session_id
322+
"""Construct a Session object with a given ``session_id``. For example:
323+
324+
.. code-block::
325+
326+
from qiskit_ibm_runtime import QiskitRuntimeService, Session
327+
service = QiskitRuntimeService()
328+
job = service.job(<job_id>)
329+
existing_session_id = job.session_id
330+
331+
new_session = Session.from_id(existing_session_id, service)
323332
324333
Args:
325334
session_id: the id of the session to be created. This must be an already

0 commit comments

Comments
 (0)