Skip to content

Commit

Permalink
fix: Introduce memoizing, to make new channels identification fully e…
Browse files Browse the repository at this point in the history
…quivalent to the previous
  • Loading branch information
alecandido committed Aug 30, 2024
1 parent b265583 commit adbcb38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/qibolab/sweeper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from enum import Enum, auto
from functools import cache
from typing import Any, Optional

import numpy as np
Expand All @@ -9,7 +10,6 @@
from .pulses import Pulse
from .serialize import Model


_PULSE = "pulse"
_CHANNEL = "channel"

Expand All @@ -25,9 +25,10 @@ class Parameter(Enum):
offset = (auto(), _CHANNEL)

@classmethod
@cache
def channels(cls) -> set["Parameter"]:
"""Set of parameters to be swept on the channel."""
return set(p for p in cls if p.value[1] == _CHANNEL)
return {p for p in cls if p.value[1] == _CHANNEL}


_Field = tuple[Any, str]
Expand Down

0 comments on commit adbcb38

Please sign in to comment.