DeepPSP / torch_ecg

Deep learning ECG models implemented using PyTorch
MIT License
172 stars 20 forks source link

Update the load_data method of the database readers #11

Closed wenh06 closed 1 year ago

wenh06 commented 1 year ago

An optional argument return_fs is added to the method load_data, by setting which to be True, the returned valued of load_data has signature

Tuple[np.ndarray, Real]

and the elements of the tuple are

data : numpy.ndarray
    The ECG data loaded from the record,
    with given `units` and `data_format`.
data_fs : numbers.Real, optional
    Sampling frequency of the output signal.

The default value for return_fs is False, so that the default behaviour of load_data is unchanged.

codecov[bot] commented 1 year ago

Codecov Report

Merging #11 (9207284) into master (8a5c9bf) will increase coverage by 0.03%. The diff coverage is 98.11%.

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
+ Coverage   92.97%   93.01%   +0.03%     
==========================================
  Files         136      136              
  Lines       18115    18155      +40     
==========================================
+ Hits        16843    16887      +44     
+ Misses       1272     1268       -4     
Files Changed Coverage Δ
torch_ecg/databases/base.py 89.54% <90.00%> (-0.06%) :arrow_down:
torch_ecg/databases/cpsc_databases/cpsc2018.py 96.29% <100.00%> (+0.06%) :arrow_up:
torch_ecg/databases/cpsc_databases/cpsc2019.py 96.85% <100.00%> (+0.06%) :arrow_up:
torch_ecg/databases/cpsc_databases/cpsc2020.py 98.05% <100.00%> (+0.03%) :arrow_up:
torch_ecg/databases/nsrr_databases/shhs.py 92.51% <100.00%> (+0.02%) :arrow_up:
torch_ecg/databases/other_databases/cachet_cadb.py 89.32% <100.00%> (+0.15%) :arrow_up:
torch_ecg/databases/other_databases/sph.py 88.12% <100.00%> (+0.10%) :arrow_up:
...rch_ecg/databases/physionet_databases/apnea_ecg.py 94.89% <100.00%> (ø)
...orch_ecg/databases/physionet_databases/cinc2018.py 93.33% <100.00%> (+0.22%) :arrow_up:
...orch_ecg/databases/physionet_databases/cinc2020.py 92.83% <100.00%> (+0.04%) :arrow_up:
... and 2 more

... and 1 file with indirect coverage changes