Skip to content

Commit 4d87d99

Browse files
committed
fix code so that it becomes compatible with numpy>=2.0
1 parent 830bb27 commit 4d87d99

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/Tutorial_DAMP.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
" # ignore the values upto `split_idx`\n",
112112
" PL[:split_idx] = np.inf\n",
113113
" \n",
114-
" discord_idx = np.where(np.isinf(PL), np.NINF, PL).argmax()\n",
114+
" discord_idx = np.where(np.isinf(PL), -np.inf, PL).argmax()\n",
115115
" discord_dist = PL[discord_idx]\n",
116116
" if discord_dist == np.inf:\n",
117117
" discord_idx = -1\n",
@@ -471,7 +471,7 @@
471471
" last_chunk_size = chunks_range[-1, 1] - chunks_range[-1, 0]\n",
472472
" last_chunk_size_cutoff = next_pow2(last_chunk_size)\n",
473473
" \n",
474-
" bsf = np.NINF \n",
474+
" bsf = -np.inf \n",
475475
" lookahead = next_pow2(m)\n",
476476
" for i in range(split_idx, l):\n",
477477
" if PL[i] >= bsf: \n",
@@ -497,7 +497,7 @@
497497
" last_chunk_size = m\n",
498498
" last_chunk_size_cutoff = 2 * last_chunk_size_cutoff\n",
499499
" \n",
500-
" discord_idx = np.where(np.isinf(PL), np.NINF, PL).argmax()\n",
500+
" discord_idx = np.where(np.isinf(PL), -np.inf, PL).argmax()\n",
501501
" discord_dist = PL[discord_idx]\n",
502502
" if discord_dist == np.inf:\n",
503503
" discord_idx = -1\n",
@@ -784,7 +784,7 @@
784784
"name": "python",
785785
"nbconvert_exporter": "python",
786786
"pygments_lexer": "ipython3",
787-
"version": "3.10.12"
787+
"version": "3.13.5"
788788
}
789789
},
790790
"nbformat": 4,

0 commit comments

Comments
 (0)