Skip to content

Commit e8ec6b0

Browse files
authored
Merge pull request MIT-LCP#440 from MIT-LCP/style
Fix code style
2 parents 3a0d339 + b654bfd commit e8ec6b0

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
run: pytest
3737
- name: Validate poetry file
3838
run: poetry check
39-
- name: Format files
40-
run: black .
39+
- name: Check source code format
40+
run: black --check --diff .
4141

4242
test-deb10-i386:
4343
runs-on: ubuntu-latest

wfdb/io/convert/edf.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ def read_edf(
189189
]
190190

191191
# Number of bytes in header (8 bytes)
192-
header_bytes = int(struct.unpack("<8s", edf_file.read(8))[0].decode(encoding))
192+
header_bytes = int(
193+
struct.unpack("<8s", edf_file.read(8))[0].decode(encoding)
194+
)
193195
if verbose:
194196
print("Number of bytes in header record: {}".format(header_bytes))
195197

@@ -222,7 +224,9 @@ def read_edf(
222224
)
223225

224226
# Duration of a block, in seconds (8 bytes)
225-
block_duration = float(struct.unpack("<8s", edf_file.read(8))[0].decode(encoding))
227+
block_duration = float(
228+
struct.unpack("<8s", edf_file.read(8))[0].decode(encoding)
229+
)
226230
if verbose:
227231
print(
228232
"Duration of each data record in seconds: {}".format(block_duration)
@@ -240,7 +244,9 @@ def read_edf(
240244
# Label (e.g., EEG FpzCz or Body temp) (16 bytes each)
241245
sig_name = []
242246
for _ in range(n_sig):
243-
temp_sig = struct.unpack("<16s", edf_file.read(16))[0].decode(encoding).strip()
247+
temp_sig = (
248+
struct.unpack("<16s", edf_file.read(16))[0].decode(encoding).strip()
249+
)
244250
if temp_sig == "EDF Annotations" and not rdedfann_flag:
245251
print(
246252
"*** This may be an EDF+ Annotation file instead, please see "
@@ -1118,7 +1124,9 @@ def rdedfann(
11181124
adjusted_hex = hex(
11191125
struct.unpack("<H", struct.pack(">H", chunk + 1))[0]
11201126
)
1121-
annotation_string += bytes.fromhex(adjusted_hex[2:]).decode(encoding)
1127+
annotation_string += bytes.fromhex(adjusted_hex[2:]).decode(
1128+
encoding
1129+
)
11221130
# Remove all of the whitespace
11231131
for rep in ["\x00", "\x14", "\x15"]:
11241132
annotation_string = annotation_string.replace(rep, " ")

0 commit comments

Comments
 (0)