Skip to content

Commit

Permalink
Re-enable remote tests (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Aug 4, 2022
1 parent 292d505 commit 301d539
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion _metadata.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__extension_version__ = "0.5.0"
__extension_version__ = "0.4.0"
__extension_name__ = "pytket-iqm"
10 changes: 3 additions & 7 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
Changelog
~~~~~~~~~

0.5.0 (unreleased)
0.4.0 (unreleased)
------------------

* Updated iqm-client version requirement to 4.2.

0.4.0 (May 2022)
----------------

* Updated iqm-client version requirement to 4.3.
* IQMBackend initializer now requires an authentication server URL, which may be
stored in config.
* Updated pytket version requirement to 1.2.
* Updated pytket version requirement to 1.5.
* Support for python 3.10.

0.3.0 (April 2022)
Expand Down
10 changes: 1 addition & 9 deletions mypy-check
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ set -evu
# single argument = root directory of module to test
# Requires mypy >= 0.800

MODULEDIR=$1

# set MYPYPATH
MYPYPATH="."
for MOD in $(ls -d "$MODULEDIR"*); do
MOD_PATH="$(cd "$MOD" && pwd)"
MYPYPATH="$MYPYPATH:$MOD_PATH"
done
export MYPYPATH="$MYPYPATH"
MYPYPATH=$1

ROOT_INIT_FILE=$(python -c "from importlib.util import find_spec; print(find_spec('pytket').origin)")

Expand Down
9 changes: 4 additions & 5 deletions pytket/extensions/iqm/backends/iqm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from iqm_client.iqm_client import ( # type: ignore
Instruction,
IQMClient,
RunStatus,
SingleQubitMapping,
)
import numpy as np
Expand Down Expand Up @@ -258,10 +257,10 @@ def circuit_status(self, handle: ResultHandle) -> CircuitStatus:
run_id = UUID(bytes=cast(bytes, handle[0]))
run_result = self._client.get_run(run_id)
status = run_result.status
if status is RunStatus.PENDING:
if status == "pending":
return CircuitStatus(StatusEnum.SUBMITTED)
elif status is RunStatus.READY:
measurements = run_result.measurements
elif status == "ready":
measurements = run_result.measurements[0]
shots = OutcomeArray.from_readouts(
np.array(
[[r[0] for r in rlist] for cbstr, rlist in measurements.items()],
Expand All @@ -277,7 +276,7 @@ def circuit_status(self, handle: ResultHandle) -> CircuitStatus:
)
return CircuitStatus(StatusEnum.COMPLETED)
else:
assert status is RunStatus.FAILED
assert status == "failed"
return CircuitStatus(StatusEnum.ERROR, run_result.message)

def get_result(self, handle: ResultHandle, **kwargs: KwargTypes) -> BackendResult:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
license="Apache 2",
packages=find_namespace_packages(include=["pytket.*"]),
include_package_data=True,
install_requires=["pytket ~= 1.4", "iqm-client ~= 4.2"],
install_requires=["pytket ~= 1.5", "iqm-client == 4.3"],
classifiers=[
"Environment :: Console",
"Programming Language :: Python :: 3.9",
Expand Down
2 changes: 0 additions & 2 deletions tests/backend_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
if skip_remote_tests is False and get(get_demo_url()).status_code != 200:
skip_remote_tests = True
REASON = "The IQM demo site/service is unavailable"
skip_remote_tests = True
REASON = "The IQM demo site/service is unavailable"


@pytest.mark.skipif(skip_remote_tests, reason=REASON)
Expand Down

0 comments on commit 301d539

Please sign in to comment.