Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code style #440

Merged
merged 2 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
run: pytest
- name: Validate poetry file
run: poetry check
- name: Format files
run: black .
- name: Check source code format
run: black --check --diff .

test-deb10-i386:
runs-on: ubuntu-latest
Expand Down
16 changes: 12 additions & 4 deletions wfdb/io/convert/edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ def read_edf(
]

# Number of bytes in header (8 bytes)
header_bytes = int(struct.unpack("<8s", edf_file.read(8))[0].decode(encoding))
header_bytes = int(
struct.unpack("<8s", edf_file.read(8))[0].decode(encoding)
)
if verbose:
print("Number of bytes in header record: {}".format(header_bytes))

Expand Down Expand Up @@ -222,7 +224,9 @@ def read_edf(
)

# Duration of a block, in seconds (8 bytes)
block_duration = float(struct.unpack("<8s", edf_file.read(8))[0].decode(encoding))
block_duration = float(
struct.unpack("<8s", edf_file.read(8))[0].decode(encoding)
)
if verbose:
print(
"Duration of each data record in seconds: {}".format(block_duration)
Expand All @@ -240,7 +244,9 @@ def read_edf(
# Label (e.g., EEG FpzCz or Body temp) (16 bytes each)
sig_name = []
for _ in range(n_sig):
temp_sig = struct.unpack("<16s", edf_file.read(16))[0].decode(encoding).strip()
temp_sig = (
struct.unpack("<16s", edf_file.read(16))[0].decode(encoding).strip()
)
if temp_sig == "EDF Annotations" and not rdedfann_flag:
print(
"*** This may be an EDF+ Annotation file instead, please see "
Expand Down Expand Up @@ -1118,7 +1124,9 @@ def rdedfann(
adjusted_hex = hex(
struct.unpack("<H", struct.pack(">H", chunk + 1))[0]
)
annotation_string += bytes.fromhex(adjusted_hex[2:]).decode(encoding)
annotation_string += bytes.fromhex(adjusted_hex[2:]).decode(
encoding
)
# Remove all of the whitespace
for rep in ["\x00", "\x14", "\x15"]:
annotation_string = annotation_string.replace(rep, " ")
Expand Down