From f9145c2170bb53a42e35f90a52442a6369164ada Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:37:41 +0200 Subject: [PATCH 1/5] fix deprecated .A attribute on coo_matrix --- elephant/spade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elephant/spade.py b/elephant/spade.py index 251fc6ecd..ddaf411cf 100644 --- a/elephant/spade.py +++ b/elephant/spade.py @@ -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( From e7cf9e0b10bbdc096bab7e2869f3907353e2ee6f Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:57:13 +0200 Subject: [PATCH 2/5] make precision for cubic explicit --- elephant/test/test_cubic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elephant/test/test_cubic.py b/elephant/test/test_cubic.py index fd6e44d7d..da6b85028 100644 --- a/elephant/test/test_cubic.py +++ b/elephant/test/test_cubic.py @@ -34,7 +34,7 @@ def setUp(self): self.data_signal = neo.AnalogSignal( numpy.array([self.xi] * n2 + [0] * n0).reshape(n0 + n2, 1) * pq.dimensionless, sampling_period=1 * pq.s) - self.data_array = numpy.array([self.xi] * n2 + [0] * n0) + self.data_array = numpy.array([self.xi] * n2 + [0] * n0, dtype=numpy.float64) self.alpha = 0.05 self.max_iterations = 10 From c3a1aa62309bb9bf4a4905ac109ec01490d6cf26 Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:48:21 +0200 Subject: [PATCH 3/5] ensure float64 precision for data when using scipy.stats.kstat --- elephant/cubic.py | 3 ++- elephant/test/test_cubic.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/elephant/cubic.py b/elephant/cubic.py index ac117406e..69200b4a2 100644 --- a/elephant/cubic.py +++ b/elephant/cubic.py @@ -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 issue with precision when calculating moments, ensure float64 (default) is the precision of data array. + moments = [scipy.stats.kstat(data.astype(np.float64), n=n) for n in [1, 2, 3]] return moments diff --git a/elephant/test/test_cubic.py b/elephant/test/test_cubic.py index da6b85028..fd6e44d7d 100644 --- a/elephant/test/test_cubic.py +++ b/elephant/test/test_cubic.py @@ -34,7 +34,7 @@ def setUp(self): self.data_signal = neo.AnalogSignal( numpy.array([self.xi] * n2 + [0] * n0).reshape(n0 + n2, 1) * pq.dimensionless, sampling_period=1 * pq.s) - self.data_array = numpy.array([self.xi] * n2 + [0] * n0, dtype=numpy.float64) + self.data_array = numpy.array([self.xi] * n2 + [0] * n0) self.alpha = 0.05 self.max_iterations = 10 From 17d4609f4a1adb4a9a7e8177e85572192555507a Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:58:14 +0200 Subject: [PATCH 4/5] fix comment --- elephant/cubic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elephant/cubic.py b/elephant/cubic.py index 69200b4a2..b32536b90 100644 --- a/elephant/cubic.py +++ b/elephant/cubic.py @@ -237,6 +237,6 @@ def _kstat(data): """ if len(data) == 0: raise ValueError('The input data must be a non-empty array') - # Due to issue with precision when calculating moments, ensure float64 (default) is the precision of data array. + # 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 From c8fcf8f6afa208985686c14f376cce9bcf5bb29d Mon Sep 17 00:00:00 2001 From: Moritz-Alexander-Kern <92092328+Moritz-Alexander-Kern@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:38:19 +0200 Subject: [PATCH 5/5] update mac-OS runner --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b22fc56ed..91f42577d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -131,14 +131,14 @@ 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 @@ -146,7 +146,7 @@ jobs: 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 }}