mongodb / signal-processing-algorithms

Apache License 2.0
39 stars 16 forks source link

Error using edivisive #19

Open angus-c opened 3 years ago

angus-c commented 3 years ago

Hi!

When I try to run a simple e-divisive example I'm getting a dependency error. I'm new to python package infrastructure so it's possible I did a bad install (I used pip)

Code

from signal_processing_algorithms.energy_statistics import energy_statistics
series = [1,2,3,4]

change_points = energy_statistics.e_divisive(series, pvalue=0.01, permutations=100)

Error

Traceback (most recent call last):
  File "/Users/me/Library/Python/3.8/lib/python/site-packages/signal_processing_algorithms/energy_statistics/cext_calculator.py", line 20, in <module>
    LIB_E_DIVISIVE = np.ctypeslib.load_library("_e_divisive", so_path)
  File "/Users/me/Library/Python/3.8/lib/python/site-packages/numpy/ctypeslib.py", line 153, in load_library
    raise OSError("no file with expected extension")
OSError: no file with expected extension
Traceback (most recent call last):
  File "edivisive-tester.py", line 1, in <module>
    from signal_processing_algorithms.energy_statistics import energy_statistics
  File "/Users/me/Library/Python/3.8/lib/python/site-packages/signal_processing_algorithms/energy_statistics/energy_statistics.py", line 9, in <module>
    from signal_processing_algorithms.energy_statistics.cext_calculator import (
ImportError: cannot import name 'calculate_distance_matrix' from 'signal_processing_algorithms.energy_statistics.cext_calculator' (/Users/me/Library/Python/3.8/lib/python/site-packages/signal_processing_algorithms/energy_statistics/cext_calculator.py)

Python 3.8.2 signal-processing-algorithms 2.0.0

uglycoyote commented 2 years ago

I'm also getting the same thing, any solution?

angus-c commented 2 years ago

IIRC I removed the C++ portion of the code.

sfc-gh-dbuse commented 1 year ago

Probably related to poetry 1.4. See https://github.com/python-poetry/poetry/issues/2740#issuecomment-1447608715 for details. Probably the solution will be to just include generate-setup-file = true in the pyproject.toml

vimiix commented 2 months ago

I got the same error.

Downgrade the version of poetry to 1.3.2 can fix this, then run:

poetry build

It will generate a whl package corresponding to the python version in the current directory