Skip to content

Commit

Permalink
Merge branch 'hs/eom-params' of https://github.com/pasqal-io/Pulser i…
Browse files Browse the repository at this point in the history
…nto hs/eom-params
  • Loading branch information
HGSilveri committed Aug 2, 2023
2 parents 5e3973d + 3fb90db commit 057ae14
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pulser-core/pulser/json/coders.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def default(self, o: Any) -> dict[str, Any]:
"""Handles JSON encoding of objects not supported by default."""
if hasattr(o, "_to_dict"):
return cast(dict, o._to_dict())
elif type(o) == type:
elif type(o) is type:
return obj_to_dict(o, _build=False, _name=o.__name__)
elif isinstance(o, np.ndarray):
return obj_to_dict(o, o.tolist(), _name="array")
Expand Down
2 changes: 1 addition & 1 deletion pulser-core/pulser/sequence/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def check_retarget(ch_obj: Channel) -> bool:

# We verify the channel class then
# check whether the addressing is Global or Local
type_match = type(old_ch_obj) == type(new_ch_obj)
type_match = type(old_ch_obj) is type(new_ch_obj)
basis_match = old_ch_obj.basis == new_ch_obj.basis
addressing_match = (
old_ch_obj.addressing == new_ch_obj.addressing
Expand Down
2 changes: 1 addition & 1 deletion tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_register_numbered_keys(reg):
j = json.dumps(reg, cls=PulserEncoder)
decoded_reg = json.loads(j, cls=PulserDecoder)
assert reg == decoded_reg
assert all([type(i) == int for i in decoded_reg.qubit_ids])
assert all([type(i) is int for i in decoded_reg.qubit_ids])


def test_mappable_register():
Expand Down

0 comments on commit 057ae14

Please sign in to comment.