diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 98cafd853..0c598bcda 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: additional_dependencies: [tomli] args: [--in-place, --config, ./pyproject.toml] - repo: https://github.com/asottile/pyupgrade - rev: v3.18.0 + rev: v3.19.0 hooks: - id: pyupgrade - repo: https://github.com/hadialqattan/pycln @@ -35,7 +35,7 @@ repos: args: - --config=pyproject.toml - repo: https://github.com/adamchainz/blacken-docs - rev: 1.19.0 + rev: 1.19.1 hooks: - id: blacken-docs - repo: https://github.com/pycqa/pydocstyle diff --git a/src/qibolab/_core/instruments/qm/controller.py b/src/qibolab/_core/instruments/qm/controller.py index 805196556..ed06c9531 100644 --- a/src/qibolab/_core/instruments/qm/controller.py +++ b/src/qibolab/_core/instruments/qm/controller.py @@ -331,7 +331,9 @@ def register_pulses(self, configs: dict[str, Config], sequence: PulseSequence): acquisitions (dict): Map from measurement instructions to acquisition objects. """ for id, pulse in sequence: - if hasattr(pulse, "duration") and not pulse.duration.is_integer(): + if hasattr(pulse, "duration") and not ( + isinstance(pulse.duration, int) or pulse.duration.is_integer() + ): raise ValueError( f"Quantum Machines cannot play pulse with duration {pulse.duration}. " "Only integer duration in ns is supported."