-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create batch class * add simple reno and test
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This code is part of Qiskit. | ||
# | ||
# (C) Copyright IBM 2023. | ||
# | ||
# 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 http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# 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. | ||
|
||
"""Qiskit Runtime batch mode.""" | ||
|
||
from .session import Session | ||
|
||
|
||
class Batch(Session): | ||
"""Class for creating a batch mode in Qiskit Runtime.""" | ||
|
||
pass |
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,6 @@ | ||
--- | ||
features: | ||
- | | ||
There is a new class, :class:`qiskit_ibm_runtime.Batch` that currently works | ||
the same way as :class:`qiskit_ibm_runtime.Session` but will later be updated | ||
to better support submitting multiple jobs at once. |
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,35 @@ | ||
# This code is part of Qiskit. | ||
# | ||
# (C) Copyright IBM 2022. | ||
# | ||
# 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 http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# 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. | ||
|
||
"""Tests for Batch class.""" | ||
|
||
from unittest.mock import patch | ||
|
||
from qiskit_ibm_runtime import Batch | ||
import qiskit_ibm_runtime.session as session_pkg | ||
from ..ibm_test_case import IBMTestCase | ||
|
||
|
||
class TestBatch(IBMTestCase): | ||
"""Class for testing the Session class.""" | ||
|
||
def tearDown(self) -> None: | ||
super().tearDown() | ||
session_pkg._DEFAULT_SESSION.set(None) | ||
|
||
@patch("qiskit_ibm_runtime.session.QiskitRuntimeService", autospec=True) | ||
def test_default_batch(self, mock_service): | ||
"""Test using default batch mode.""" | ||
mock_service.global_service = None | ||
batch = Batch(backend="ibm_gotham") | ||
self.assertIsNotNone(batch.service) | ||
mock_service.assert_called_once() |