Skip to content
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
1 change: 0 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np


_np_error_state = {}


Expand Down
1 change: 0 additions & 1 deletion wfdb/io/_coreio.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from wfdb.io import _url
from wfdb.io.download import config


# Cloud protocols
CLOUD_PROTOCOLS = ["az://", "azureml://", "s3://", "gs://"]

Expand Down
5 changes: 2 additions & 3 deletions wfdb/io/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from wfdb.version import __version__


# Value for 'buffering' indicating that the entire file should be
# buffered at once.
BUFFER_WHOLE_FILE = -2
Expand Down Expand Up @@ -486,7 +485,7 @@ def _read_range(self, start, end):
if buffer_store:
# Load data into buffer and then return a copy to the
# caller.
(start, data) = xfer.content()
start, data = xfer.content()
self._buffer = data
self._buffer_start = start
self._buffer_end = start + len(data)
Expand Down Expand Up @@ -767,7 +766,7 @@ def openurl(
(io.BufferedIOBase) or text file API (io.TextIOBase).

"""
(scheme, netloc, path, _, _, _) = urllib.parse.urlparse(url)
scheme, netloc, path, _, _, _ = urllib.parse.urlparse(url)
if scheme == "":
raise NetFileError("no scheme specified for URL: %r" % (url,), url=url)

Expand Down
12 changes: 7 additions & 5 deletions wfdb/io/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,9 @@ def convert_label_attribute(
return

label_map = self.create_label_map(inplace=False)
label_map.set_index(keys=pd.Index(label_map[source_field].values), inplace=True)
label_map.set_index(
keys=pd.Index(label_map[source_field].values), inplace=True
)

try:
target_item = label_map.loc[
Expand Down Expand Up @@ -1959,7 +1961,7 @@ def rdann(
filebytes = load_byte_pairs(record_name, extension, pn_dir)

# Get WFDB annotation fields from the file bytes
(sample, label_store, subtype, chan, num, aux_note) = proc_ann_bytes(
sample, label_store, subtype, chan, num, aux_note = proc_ann_bytes(
filebytes, sampto
)

Expand All @@ -1970,17 +1972,17 @@ def rdann(
)

# Try to extract information describing the annotation file
(fs, custom_labels) = interpret_defintion_annotations(
fs, custom_labels = interpret_defintion_annotations(
potential_definition_inds, aux_note
)

# Remove annotations that do not store actual sample and label information
(sample, label_store, subtype, chan, num, aux_note) = rm_empty_indices(
sample, label_store, subtype, chan, num, aux_note = rm_empty_indices(
rm_inds, sample, label_store, subtype, chan, num, aux_note
)

# Convert lists to numpy arrays dtype='int'
(label_store, subtype, chan, num) = lists_to_int_arrays(
label_store, subtype, chan, num = lists_to_int_arrays(
label_store, subtype, chan, num
)

Expand Down
12 changes: 4 additions & 8 deletions wfdb/io/convert/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,20 +625,16 @@ def csv2ann(
df_CSV.columns = ["onset", "duration", "description"]
df_out = format_ann_from_df(df_CSV)
else:
raise Exception(
"""The number of columns in the CSV was not
recognized."""
)
raise Exception("""The number of columns in the CSV was not
recognized.""")

# Remove extension from input file name
file_name = file_name.split(".")[0]
if time_onset:
if not fs:
raise Exception(
"""`fs` must be provided if `time_onset` is True
raise Exception("""`fs` must be provided if `time_onset` is True
since it is required to convert time onsets to
samples"""
)
samples""")
sample = (df_out["onset"].to_numpy() * fs).astype(np.int64)
else:
sample = df_out["onset"].to_numpy()
Expand Down
1 change: 0 additions & 1 deletion wfdb/io/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from wfdb.io import _url


# The PhysioNet index url
PN_INDEX_URL = "https://physionet.org/files/"
PN_CONTENT_URL = "https://physionet.org/content/"
Expand Down
1 change: 0 additions & 1 deletion wfdb/io/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from wfdb.io import util
from wfdb.io._coreio import CLOUD_PROTOCOLS


# -------------- WFDB Signal Calibration and Classification ---------- #


Expand Down