Skip to content

Commit

Permalink
Update Precommit (#991)
Browse files Browse the repository at this point in the history
* Update precommit YAML to be inline with Github CI

* Satisfy ruff reqs

* Satisfy ruff reqs (again)

---------

Co-authored-by: Phillip Weinberg <weinbe58@gmail.com>
  • Loading branch information
johnzl-777 and weinbe58 authored Jul 29, 2024
1 parent 544cb17 commit e1114ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
args: ['--unsafe']
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.1.0
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.0.264"
rev: "v0.5.5"
hooks:
- id: ruff
4 changes: 2 additions & 2 deletions tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_scale():
# print(type(list(seq.pulses.keys())[0]))
Loc1 = list(seq.pulses[rydberg].fields[detuning].drives.keys())[0]

assert type(Loc1) == ir.ScaledLocations
assert type(Loc1) is ir.ScaledLocations
assert Loc1.value[ir.Location(1)] == cast(1.2)


Expand Down Expand Up @@ -250,7 +250,7 @@ def test_record():
.record("detuning")
)

assert type(prog) == waveform.Record
assert type(prog) is waveform.Record

seq = prog.parse_sequence()
assert seq.pulses[rydberg].fields[detuning].drives[
Expand Down
4 changes: 2 additions & 2 deletions tests/test_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_addlocs_on_square():
lattice1 = lattice.add_position([(9, 6), (4, 4)])

# type(lattice)
assert type(lattice1) == ir.location.ListOfLocations
assert type(lattice1) is ir.location.ListOfLocations

positions1 = set(map(lambda info: info.position, lattice1.enumerate()))
positions_expected1 = set(cast([(0, 0), (1, 0), (0, 1), (1, 1), (9, 6), (4, 4)]))
Expand All @@ -94,7 +94,7 @@ def test_addlocs_filling_options():
lattice = lattice.add_position([(9, 6), (4, 4)], filling=[False, True])

# type(lattice)
assert type(lattice) == ir.location.ListOfLocations
assert type(lattice) is ir.location.ListOfLocations

for info in lattice.enumerate():
if info.position == cast((9, 6)):
Expand Down

0 comments on commit e1114ac

Please sign in to comment.