Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
HaroldErbin committed Nov 19, 2024
1 parent cf48c7a commit 93278c8
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions pulser-core/pulser/devices/_device_datacls.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,11 @@ def _specs(self, for_docs: bool = False) -> str:
if self.max_runs is not None:
device_lines.append(f" - Maximum number of runs: {self.max_runs}")
device_lines += [
f" - Channels can be reused: {'Yes' if self.reusable_channels else 'No'}",
(
" - Channels can be reused: " "Yes"
if self.reusable_channels
else "No"
),
f" - Supported bases: {', '.join(self.supported_bases)}",
f" - Supported states: {', '.join(self.supported_states)}",
]
Expand All @@ -639,12 +643,12 @@ def _specs(self, for_docs: bool = False) -> str:
"\nLayout parameters:",
f" - Requires layout: {'Yes' if self.requires_layout else 'No'}",
]
try:
if hasattr(self, "accepts_new_layouts"):
layout_lines.append(
f" - Accepts new layout: {'Yes' if self.accepts_new_layouts else 'No'}"
" - Accepts new layout: " "Yes"
if self.accepts_new_layouts
else "No"
)
except AttributeError:
pass

layout_lines += [
f" - Minimal number of traps: {self.min_layout_traps}",
Expand All @@ -659,11 +663,15 @@ def _specs(self, for_docs: bool = False) -> str:
except (AttributeError, TypeError):
max_amp = "None"
try:
max_abs_detuning = f"{float(cast(float, ch.max_abs_detuning)):.4g} rad/µs"
max_abs_detuning = (
f"{float(cast(float, ch.max_abs_detuning)):.4g} rad/µs"
)
except (AttributeError, TypeError):
max_abs_detuning = "None"
try:
bottom_detuning = f"{float(cast(float, ch.bottom_detuning)):.4g} rad/µs"
bottom_detuning = (
f"{float(cast(float, ch.bottom_detuning)):.4g} rad/µs"
)
except (AttributeError, TypeError):
bottom_detuning = "None"

Expand Down

0 comments on commit 93278c8

Please sign in to comment.