Skip to content

Commit 935db4b

Browse files
Merge branch 'master' into fix/index_error_synchrotool_493
2 parents 589b276 + bb0a394 commit 935db4b

File tree

3 files changed

+188
-274
lines changed

3 files changed

+188
-274
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,14 @@ jobs:
135135
matrix:
136136
# OS [ubuntu-latest, macos-latest, windows-latest]
137137
os: [macos-13,macos-14]
138-
python-version: [3.11]
138+
python-version: [3.12]
139139
steps:
140140
- name: Get current year-month
141141
id: date
142142
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
143143

144144
- uses: actions/[email protected]
145145

146-
- name: Cache conda
147-
uses: actions/cache@v4
148-
with:
149-
path: ~/conda_pkgs_dir
150-
key: ${{ runner.os }}-conda-${{hashFiles('requirements/environment.yml') }}-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}
151-
152146
- name: Get current hash (SHA) of the elephant_data repo
153147
id: elephant-data
154148
run: |
@@ -162,29 +156,17 @@ jobs:
162156
key: datasets-${{ steps.elephant-data.outputs.dataset_hash }}
163157
restore-keys: datasets-
164158

165-
- uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # corresponds to v3.1.0
166-
with:
167-
auto-update-conda: true
168-
python-version: ${{ matrix.python-version }}
169-
mamba-version: "*"
170-
channels: conda-forge
171-
channel-priority: true
172-
activate-environment: elephant
173-
environment-file: requirements/environment-tests.yml
174-
conda-remove-defaults: true
175-
176159
- name: Install dependencies
177160
shell: bash -l {0}
178161
run: |
179162
python --version
180-
mamba install pytest pytest-cov coveralls
181-
pip install -e .[extras]
163+
pip install -e .[extras,tests]
164+
pip install pytest-cov coveralls
182165
183166
- name: List packages
184167
shell: bash -l {0}
185168
run: |
186169
pip list
187-
mamba list
188170
python --version
189171
190172
- name: Test with pytest

elephant/conversion.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,17 @@ def __getitem__(self, item):
708708
the returned binned sparse matrix will affect the original data.
709709
"""
710710
# taken from csr_matrix.__getitem__
711-
row, col = self.sparse_matrix._validate_indices(item)
711+
valid_indices = self.sparse_matrix._validate_indices(item)
712+
# TODO: The following is a hot fix to compensate an API change in SciPy 1.15 (#653)
713+
# Currently, we cannot set scipy>=1.15 since this would not allow for Python 3.9.
714+
# Once we phase out support for Python 3.9, remove the if statement and the else
715+
# branch and require scipy>=1.15.
716+
if isinstance(valid_indices[0], tuple):
717+
# New version of SciPy (1.15 and later)
718+
row, col = valid_indices[0]
719+
else:
720+
# Previous version of SciPy
721+
row, col = valid_indices
712722
spmat = self.sparse_matrix[item]
713723
if np.isscalar(spmat):
714724
# data with one element

0 commit comments

Comments
 (0)