diff --git a/wfdb/io/_header.py b/wfdb/io/_header.py index a5dc2872..a1feb5f2 100644 --- a/wfdb/io/_header.py +++ b/wfdb/io/_header.py @@ -1,5 +1,5 @@ import datetime -from typing import Collection, List, Tuple +from typing import Any, Dict, List, Optional, Sequence, Tuple import numpy as np import pandas as pd @@ -598,6 +598,10 @@ class MultiHeaderMixin(BaseHeaderMixin): """ + n_seg: int + seg_len: Sequence[int] + segments: Optional[Sequence] + def set_defaults(self): """ Set defaults for fields needed to write the header if they have @@ -920,7 +924,7 @@ def contained_ranges(self, sig_name: str) -> List[Tuple[int, int]]: def contained_combined_ranges( self, - sig_names: Collection[str], + sig_names: Sequence[str], ) -> List[Tuple[int, int]]: """ Given a collection of signal name, return the sample ranges that @@ -1010,7 +1014,7 @@ def _parse_record_line(record_line: str) -> dict: """ # Dictionary for record fields - record_fields = {} + record_fields: Dict[str, Any] = {} # Read string fields from record line match = rx_record.match(record_line) diff --git a/wfdb/io/download.py b/wfdb/io/download.py index ace112f9..d494ad0e 100644 --- a/wfdb/io/download.py +++ b/wfdb/io/download.py @@ -23,7 +23,7 @@ class Config(object): """ - pass + db_index_url: str # The configuration database index url. Uses PhysioNet index by default. diff --git a/wfdb/io/record.py b/wfdb/io/record.py index 860c908d..94cae73b 100644 --- a/wfdb/io/record.py +++ b/wfdb/io/record.py @@ -1661,7 +1661,7 @@ def multi_to_single(self, physical, return_res=64, expanded=False): # this library ALLOWED_TYPES = dict( [ - [index, _header.FIELD_SPECS.loc[index, "allowed_types"]] + (index, _header.FIELD_SPECS.loc[index, "allowed_types"]) for index in _header.FIELD_SPECS.index ] ) diff --git a/wfdb/io/util.py b/wfdb/io/util.py index 12ecde33..1b3f4ad9 100644 --- a/wfdb/io/util.py +++ b/wfdb/io/util.py @@ -4,7 +4,7 @@ import math import os -from typing import Sequence, Tuple +from typing import List, Sequence, Tuple def lines_to_file(file_name: str, write_dir: str, lines: Sequence[str]): @@ -102,8 +102,9 @@ def upround(x, base): def overlapping_ranges( - ranges_1: Tuple[int, int], ranges_2: Tuple[int, int] -) -> Tuple[int, int]: + ranges_1: Sequence[Tuple[int, int]], + ranges_2: Sequence[Tuple[int, int]], +) -> List[Tuple[int, int]]: """ Given two collections of integer ranges, return a list of ranges in which both input inputs overlap.