Aura-healthcare / hrv-analysis

Package for Heart Rate Variability analysis in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix Error: Cannot import LombScargle from astropy.stats

Shikha2691 opened this issue · comments

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'.

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