Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] CuBIC, SPADE with scipy 1.14.0, deprecated .A attribute in scipy.sparse matrices` #636

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,22 @@ jobs:
fail-fast: false
matrix:
# OS [ubuntu-latest, macos-latest, windows-latest]
os: [macos-11,macos-12]
os: [macos-12,macos-13]
python-version: [3.11]
steps:
- name: Get current year-month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.6

- name: Cache conda
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{hashFiles('requirements/environment.yml') }}-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}

- uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # corresponds to v3.0.3
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # corresponds to v3.0.4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
Expand Down
3 changes: 2 additions & 1 deletion elephant/cubic.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,6 @@ def _kstat(data):
"""
if len(data) == 0:
raise ValueError('The input data must be a non-empty array')
moments = [scipy.stats.kstat(data, n=n) for n in [1, 2, 3]]
# Due to issues with precision, ensure float64 (default) is the precision of the data array. (scipy == 1.14.0)
moments = [scipy.stats.kstat(data.astype(np.float64), n=n) for n in [1, 2, 3]]
return moments
2 changes: 1 addition & 1 deletion elephant/spade.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def _build_context(binary_matrix, winlen):
(np.ones((len(windows_col)), dtype=bool),
(windows_row, windows_col)),
shape=(num_bins, winlen * num_neurons),
dtype=bool).A
dtype=bool).toarray()
# Array containing all the possible attributes (each spike is indexed by
# a number equal to neu idx*winlen + bin_idx)
attributes = np.array(
Expand Down
Loading