Skip to content

Commit

Permalink
Releases/0.22.x (#165)
Browse files Browse the repository at this point in the history
* 0.22.0

* now qprograms serialize to str instead of dict

* fix unit tests

* exclude qtesting from tests
  • Loading branch information
ziiiki authored Sep 23, 2024
1 parent 54b77b2 commit 6901cc6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 0.22.0
## 0.22.1

- Support new QProgram serialization.

## 0.21.0

Expand Down
2 changes: 1 addition & 1 deletion src/qiboconnection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""


__version__ = "0.22.0"
__version__ = "0.22.1"


from .about import about
Expand Down
4 changes: 2 additions & 2 deletions src/qiboconnection/typings/job_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def __init__(self, **kwargs):
self.result = parse_job_response_to_result(job_response=JobResponse.from_kwargs(**kwargs)) # type: ignore
self.description = deserialize_job_description(raw_description=self.description, job_type=self.job_type)

if not isinstance(self.result, (dict, list, type(None))):
raise ValueError("Job result needs to be a dict, a list or a None!")
if not isinstance(self.result, (dict, list, str, type(None))):
raise ValueError("Job result needs to be a dict, a list, a string or a None!")
if not isinstance(self.description, (dict, type(None), Circuit, list, str)):
raise ValueError("Job description needs to be a Qibo Circuit, a dict, a list, a str or a None!")

Expand Down
2 changes: 1 addition & 1 deletion tests/end2end/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_devices_listing_params(user_role: UserRole = UserRole.ADMIN) -> list[Dev
dev_devices = [
device
for device in qibo_api.list_devices()._devices
if device.name not in ["qtesting_saruman", "qtesting_galadriel"]
if device.name not in ["qtesting_saruman", "qtesting_galadriel", "qili_qtesting"]
]
return dev_devices
except HTTPError:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_job_listing_typings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def test_JobData_typing_result_raises_value_error():
job_type="jaiof",
number_shots=84,
description=json.dumps(compress_any("Not string or list")),
result=json.dumps(compress_any("Not string or list")),
result=42,
name="test",
summary="test",
)

assert ex.match("Job result needs to be a dict, a list or a None!")
assert ex.match("Job result needs to be a dict, a list, a string or a None!")


@patch("qiboconnection.typings.job_data.deserialize_job_description", autospec=True)
Expand Down

0 comments on commit 6901cc6

Please sign in to comment.