Skip to content

Commit

Permalink
Comply with latest style guidelines (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
HGSilveri authored Aug 2, 2023
1 parent d5ac020 commit 0d8d4b1
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 @@ -514,7 +514,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 0d8d4b1

Please sign in to comment.