annoviko / annoviko/pyclustering
Numpy depreciation of `numpy.complex`throws error in `fsync_network`
- Linguagem predominante
- Python
- Estrelas
- 1.2k
- Forks
- 262
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Running the following code with numpy 1.2+
```
from pyclustering.nnet.fsync import fsync_network
# Prepare oscillatory network parameters.
amount_oscillators = 3;
frequency = 1.0;
radiuses = [1.0, 2.0, 3.0];
coupling_strength = 1.0;
# Create oscillatory network
oscillatory_network = fsync_network(amount_oscillators, frequency, radiuses, coupling_strength);
# Simulate network during 200 steps on 10 time-units of time-axis.
output_dynamic = oscillatory_network.simulate(200, 10, True);
```
Gives the error:
```
AttributeError: module 'numpy' has no attribute 'complex'.
`np.complex` was a deprecated alias for the builtin `complex`. To avoid this error in existing code, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
```
I'm not familiar with this package but it's possible that replacing `np.complex` with `complex` will fix this problem. I'll try forking and if it's not too involved I'll submit a PR.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.