Aura-healthcare / hrv-analysis

Package for Heart Rate Variability analysis in Python
GNU General Public License v3.0
375 stars 93 forks source link

Fix Error: Cannot import LombScargle from astropy.stats #43

Open Shikha2691 opened 4 months ago

Shikha2691 commented 4 months ago

Hello,

I encountered an ImportError while using the hrvanalysis package due to an outdated import statement for LombScargle. The LombScargle class has been moved from astropy.stats to astropy.timeseries in newer versions of astropy.

Error message: ImportError: cannot import name 'LombScargle' from 'astropy.stats' (/usr/local/lib/python3.10/dist-packages/astropy/stats/init.py)

Request to update the import statement in the hrvanalysis codebase from:

"from astropy.stats import LombScargle" to "from astropy.timeseries import LombScargle"

This change resolved the import issues in my environment, and I believe updating this in the package would help maintain compatibility with current and future versions of 'astropy'.

wenshaowu commented 2 months ago

Python package "astropy" 5.3.4 version works for me but 6.1.0 does not.