Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

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

Closed
megrao opened this issue Jun 14, 2021 · 7 comments
Closed

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

megrao opened this issue Jun 14, 2021 · 7 comments
Assignees
Labels

Comments

@megrao
Copy link

megrao commented Jun 14, 2021

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 megrao changed the title Unable to import use the bcg functionality in the latest version Unable to import use the bcg module in the latest version Jun 14, 2021
@megrao megrao changed the title Unable to import use the bcg module in the latest version Unable to import the bcg module in the latest version Jun 14, 2021
@afonsocraposo afonsocraposo self-assigned this Jun 14, 2021
@megrao
Copy link
Author

megrao commented Jun 14, 2021

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

@afonsocraposo
Copy link
Contributor

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

@megrao
Copy link
Author

megrao commented Jun 14, 2021

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
Copy link
Contributor

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

@megrao
Copy link
Author

megrao commented Jun 14, 2021

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
Copy link
Contributor

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
Copy link
Author

megrao commented Jun 14, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants