From 3f529768a46f7c1b550b66c813757a61eded1aeb Mon Sep 17 00:00:00 2001 From: Neal Erickson Date: Wed, 27 Sep 2023 14:33:12 -0600 Subject: [PATCH] small changes --- pytket/phir/sharding/sharder.py | 4 ++-- tests/test_sharder.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pytket/phir/sharding/sharder.py b/pytket/phir/sharding/sharder.py index 482df68..7f5ab54 100644 --- a/pytket/phir/sharding/sharder.py +++ b/pytket/phir/sharding/sharder.py @@ -51,7 +51,7 @@ def _process_command(self, command: Command) -> None: msg = f"OpType {command.op.type} not supported!" raise NotImplementedError(msg) - if self._is_op_schedulable(command.op): + if self.is_op_schedulable(command.op): print(f"Scheduling command: {command}") self._build_shard(command) else: @@ -79,7 +79,7 @@ def _add_pending_command(self, command: Command) -> None: self._pending_commands[command.args[0]].append(command) @staticmethod - def _is_op_schedulable(op: Op) -> bool: + def is_op_schedulable(op: Op) -> bool: """ Returns `True` if the operation is one that should be scheduled, that is, that will have a shard created for it. This includes non-gate operations diff --git a/tests/test_sharder.py b/tests/test_sharder.py index ee8815a..dbfe57b 100644 --- a/tests/test_sharder.py +++ b/tests/test_sharder.py @@ -21,4 +21,4 @@ def test_ctor(self) -> None: output = sharder.shard() - assert len(output) == 2 # noqa: PLR2004 + assert len(output) == 3 # noqa: PLR2004