annoviko / annoviko/pyclustering

Numpy depreciation of `numpy.complex`throws error in `fsync_network`

Đang mở
#700 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.2k
Fork
262
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.