PIA-Group / BioSPPy

Biosignal Processing in Python
Other
569 stars 273 forks source link

Unable to import the bcg module in the latest version #81

Closed megrao closed 3 years ago

megrao commented 3 years ago

Here is the error -

ImportError Traceback (most recent call last)

in 1 from biosppy import storage ----> 2 from biosppy.signals import bcg 3 4 # process it and plot 5 out = bcg.bcg(signal=b1_s1_normbreath, sampling_rate=250, show=True) ImportError: cannot import name 'bcg' from 'biosppy.signals' (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/biosppy/signals/__init__.py)
megrao commented 3 years ago

Hi, looks like init.py does not include bcg in the import statement

afonsocraposo commented 3 years ago

Hi @megrao , You're right. Thank you for bringing up this issue! Fixed in commit 89023f85c8b7f7ae0c21476c39674842c0c35974.

megrao commented 3 years ago

Hi @Afonsocraposo, Thanks very much! In PyPi latest release, it would be great to have BCG as there are very few python packages that seem to process them.

afonsocraposo commented 3 years ago

Done :) https://pypi.org/project/biosppy/

megrao commented 3 years ago

Huge thanks! It will be immensely useful. I tried to do a test run and got the below error.

AttributeError Traceback (most recent call last)

in 4 5 # process it and plot ----> 6 out = bcg.bcg(signal=norm_breath, sampling_rate=250, show=True) /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/biosppy/signals/bcg.py in bcg(signal, sampling_rate, show) 102 # plot 103 if show: --> 104 plotting.plot_bcg(ts=ts, 105 raw=signal, 106 filtered=filtered, **AttributeError: module 'biosppy.plotting' has no attribute 'plot_bcg'**
afonsocraposo commented 3 years ago

I updated the version on PyPI to 0.7.2. Maybe wait a bit so PyPI update the available version. You can always clone the repository and use it on your project doing:

import sys
sys.path.insert(0, '/path/to/BioSPPy')
import biosppy
megrao commented 3 years ago

Great, thanks very much! I just wanted to let you know of any errors I encounter. It works perfectly now.