Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
a-corni committed Dec 10, 2024
1 parent caa568b commit ed6d8e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_dmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def test_detuning_map_bad_init(
DetuningMap([(0, 0), (1, 0)], [0])

for reg in (layout, map_reg, register):
bad_weights: dict[int | str, float]
if reg == register:
bad_weights = {"0": -1.0, "1": 1.0, "2": 1.0}
else:
Expand All @@ -202,13 +203,16 @@ def test_init(

for reg in (layout, map_reg, register):
for detuning_map_dict in (det_dict, slm_dict):
reg_det_map_dict: dict[int | str, float]
if reg == register:
reg_det_map_dict = {
str(id): weight
for (id, weight) in detuning_map_dict.items()
}
else:
reg_det_map_dict = detuning_map_dict.copy()
reg_det_map_dict = cast(
dict[int | str, float], detuning_map_dict
)
detuning_map = cast(
DetuningMap,
reg.define_detuning_map(reg_det_map_dict), # type: ignore
Expand Down

0 comments on commit ed6d8e4

Please sign in to comment.