Skip to content

Commit

Permalink
0.0.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabrock94 committed Mar 9, 2022
1 parent 15cc9f2 commit 7402376
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pysiology/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from . import electrodermalactivity
from . import sampledata

__version__ = '0.0.9.4' #Version Control
__version__ = '0.0.9.5' #Version Control

print("Thank you for using Pysiology. If you use it in your work, please cite:")
print("Gabrieli G., Azhari A., Esposito G. (2020) PySiology: A Python Package for Physiological Feature Extraction. In: Esposito A., Faundez-Zanuy M., Morabito F., Pasero E. (eds) Neural Approaches to Dynamics of Signal Exchanges. Smart Innovation, Systems and Technologies, vol 151. Springer, Singapore")
20 changes: 13 additions & 7 deletions pysiology/electrocardiography.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ def getPNN50(peaks,samplerate):
for i in range(1,len(delta)):
differences.append(delta[i] - delta[i-1])

NN50 = [x for x in differences if x > 50]
pNN50 = float(len(NN50)) / float(len(differences))
return(pNN50)
if(len(differences)!=0):
NN50 = [x for x in differences if x > 50]
pNN50 = float(len(NN50)) / float(len(differences))
return(pNN50)
else:
return(np.nan)

def getPNN20(peaks,samplerate):
""" This functions evaluate pNN20, the proportion of differences greater than 20ms.
Expand All @@ -171,10 +174,13 @@ def getPNN20(peaks,samplerate):
differences = []
for i in range(1,len(delta)):
differences.append(delta[i] - delta[i-1])

NN20 = [x for x in differences if x > 20]
pNN20 = float(len(NN20)) / float(len(differences))
return(pNN20)

if(len(differences)!=0):
NN20 = [x for x in differences if x > 20]
pNN20 = float(len(NN20)) / float(len(differences))
return(pNN20)
else:
return(np.nan)

def getPSD(rawECGSignal, samplerate):
frequencies, psd = scipy.signal.periodogram(rawECGSignal, fs=samplerate, scaling="spectrum")
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import os

setup(name='pysiology',
version='0.0.9.4',
version='0.0.9.5',
description='Physiological signal processing in Python',
long_description="A simple python package for physiological signal processing (ECG,EMG,GSR). Tutorial and documentation can be found on the Github Repository or at pysiology.rtfd.io. If you use this package in your work, please cite: Gabrieli G., Azhari A., Esposito G. (2020) PySiology: A Python Package for Physiological Feature Extraction. In: Esposito A., Faundez-Zanuy M., Morabito F., Pasero E. (eds) Neural Approaches to Dynamics of Signal Exchanges. Smart Innovation, Systems and Technologies, vol 151. Springer, Singapore",
url='https://github.com/Gabrock94/Pysiology',
download_url='https://github.com/Gabrock94/Pysiology/archive/0.0.7.tar.gz',
download_url='https://github.com/Gabrock94/Pysiology/archive/0.9.5.tar.gz',
author='Giulio Gabrieli',
author_email='[email protected]',
license='GPL-3.0',
Expand Down

0 comments on commit 7402376

Please sign in to comment.