Skip to content

Commit 30cedfa

Browse files
committed
Run Ruff
1 parent d7e433e commit 30cedfa

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

peakdet/_version.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
9797
print("unable to find command, tried %s" % (commands,))
9898
return None, None
9999
stdout = p.communicate()[0].strip()
100-
if sys.version_info[0] >= 3:
101-
stdout = stdout.decode()
100+
stdout = stdout.decode()
102101
if p.returncode != 0:
103102
if verbose:
104103
print("unable to run %s (error)" % dispcmd)
@@ -116,7 +115,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
116115
"""
117116
rootdirs = []
118117

119-
for i in range(3):
118+
for _i in range(3):
120119
dirname = os.path.basename(root)
121120
if dirname.startswith(parentdir_prefix):
122121
return {
@@ -524,7 +523,7 @@ def get_versions():
524523
# versionfile_source is the relative path from the top of the source
525524
# tree (where the .git directory might live) to this file. Invert
526525
# this to find the root from __file__.
527-
for i in cfg.versionfile_source.split("/"):
526+
for _i in cfg.versionfile_source.split("/"):
528527
root = os.path.dirname(root)
529528
except NameError:
530529
return {

peakdet/editor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def __init__(self, data):
6262
reject = functools.partial(self.on_edit, method="reject")
6363
insert = functools.partial(self.on_edit, method="insert")
6464

65-
# Check matplotlib version rectprops is deprecated with matplotlib 3.5.0 and then obsolete
65+
# Check matplotlib version rectprops is deprecated with matplotlib 3.5.0
66+
# and then obsolete
6667
if Version(matplotlib.__version__) >= Version("3.5.0"):
6768
property_name = "props"
6869
else:

peakdet/tests/test_editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ def test_PhysioEditor():
1616
edits.on_wheel(wheel(10))
1717

1818
# test reject / delete functionality
19-
for m in range(2):
19+
for _m in range(2):
2020
edits.on_remove(0, 10, reject=True)
2121
edits.on_remove(10, 20, reject=False)
2222

2323
# undo delete + reject
24-
for m in range(2):
24+
for _m in range(2):
2525
edits.undo()
2626

2727
# test key undo (and undo when history doesn't exist)

peakdet/tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_new_physio_like():
6969
assert new_data.fs == 50
7070
assert new_data.data.dtype == int
7171
assert new_data.history == []
72-
for k, v in new_data._metadata.items():
72+
for _k, v in new_data._metadata.items():
7373
assert v.size == 0
7474

7575

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ convention = 'numpy'
4242
'*.pyi' = ['E501']
4343
'__init__.py' = ['F401']
4444
'_version.py' = ['UP031']
45+
'conftest.py' = ['D']
46+
'due.py' = ['D']
4547
'peakdet/tests/*' = ['D']
4648
'peakdet/__init__.py' = ['F401', 'D']
4749
'peakdet/*/__init__.py' = ['F401', 'D']
4850
'peakdet/_version.py' = ['UP031', 'D']
49-
'peakdet/conftest.py' = ['D']
50-
'peakdet/due.py' = ['D']
51+
'peakdet/modalities.py' = ['D']
52+
'peakdet/analytics.py' = ['D']
5153

5254

5355
# ignore = E126, E402, W503, W401, W811

0 commit comments

Comments
 (0)