Skip to content

Commit

Permalink
Reverting __repr__ for Channels to default from dataclass, old __repr…
Browse files Browse the repository at this point in the history
…__ now on __str__ (#770)
  • Loading branch information
RafaelMALima authored Dec 2, 2024
1 parent e8e4f23 commit e27d45a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pulser-core/pulser/channels/base_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_states_from_bases(bases: Collection[str]) -> list[States]:
return [state for state in STATES_RANK if state in all_states]


@dataclass(init=True, repr=False, frozen=True)
@dataclass(init=True, frozen=True)
class Channel(ABC):
"""Base class of a hardware channel.
Expand Down Expand Up @@ -595,7 +595,7 @@ def _eom_buffer_mod_bandwidth(self) -> float:
rise_time_us = self._eom_buffer_time / 2 * 1e-3
return MODBW_TO_TR / rise_time_us

def __repr__(self) -> str:
def __str__(self) -> str:
config = (
f".{self.addressing}(Max Absolute Detuning: "
f"{self.max_abs_detuning}"
Expand Down
6 changes: 3 additions & 3 deletions pulser-core/pulser/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pulser.channels.eom import RydbergEOM


@dataclass(init=True, repr=False, frozen=True)
@dataclass(init=True, frozen=True)
class Raman(Channel):
"""Raman beam channel.
Expand All @@ -36,7 +36,7 @@ def basis(self) -> Literal["digital"]:
return "digital"


@dataclass(init=True, repr=False, frozen=True)
@dataclass(init=True, frozen=True)
class Rydberg(Channel):
"""Rydberg beam channel.
Expand All @@ -62,7 +62,7 @@ def basis(self) -> Literal["ground-rydberg"]:
return "ground-rydberg"


@dataclass(init=True, repr=False, frozen=True)
@dataclass(init=True, frozen=True)
class Microwave(Channel):
"""Microwave adressing channel.
Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/channels/dmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
OPTIONAL_ABSTR_DMM_FIELDS = ["total_bottom_detuning"]


@dataclass(init=True, repr=False, frozen=True)
@dataclass(init=True, frozen=True)
class DMM(Channel):
"""Defines a Detuning Map Modulator (DMM) Channel.
Expand Down

0 comments on commit e27d45a

Please sign in to comment.