NSRRDataBase

class torch_ecg.databases.NSRRDataBase(db_name: str, db_dir: str | bytes | PathLike | None = None, working_dir: str | bytes | PathLike | None = None, verbose: int = 1, **kwargs: Any)[source]

Bases: _DataBase

Base class for readers for the NSRR database.

For a full list of available databases, and their descriptions, please visit the NSRR database webpage [1].

Parameters:
  • db_name (str) – Name of the database.

  • db_dir (path-like, optional) – Local storage path of the database.

  • working_dir (path-like, optional) – Working directory, to store intermediate files and log files.

  • verbose (int, default 1) – Verbosity level for logging.

  • kwargs (dict, optional) – Auxilliary key word arguments.

References

get_subject_id(rec: str | int) int[source]

Attach a unique subject ID for the record.

Parameters:

rec (str or int) – Record name or index of the record in all_records.

Returns:

Subject ID associated with the record.

Return type:

int

helper(items: str | List[str] | None = None) None[source]

Print corr. meanings of symbols belonging to items.

Parameters:

items (str or List[str], optional) – Items to print. If is None, then a comprehensive printing of meanings of all symbols will be performed.

Return type:

None

safe_edf_file_operation(operation: str = 'close', full_file_path: str | bytes | PathLike | None = None) None[source]

Safe IO operation for edf file.

Parameters:
  • operation ({"open", "close"}, optional) – Operation name, by default “close”.

  • full_file_path (path-like, optional) – Path of the file which contains the data. If is None, default path will be used.

Return type:

None

Raises:

ValueError – If the operation is not supported.

show_rec_stats(rec: str | int) None[source]

Print the statistics about the record.

Parameters:

rec (str or int) – Record name or index of the record in all_records.

Return type:

None