Skip to content

Commit 2684ede

Browse files
joelrahmanclaude
andcommitted
Fix numpy 2.4 compat: use .item() for array-to-scalar conversion
nYearsPool is a 2D array; indexing one dimension yields a 1-element array which numpy 2.4 no longer allows int() on directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6a911bf commit 2684ede

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pyraingen/dailysequences.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ def dailySequences(nSeasons,
6262
workingRainDepth = np.zeros((3,1))
6363
for loopSeason in range(nSeasons):
6464
# Allocate RAM for this daily series:
65+
nYears = int(nYearsPool[loopSeason].item())
6566
dailyDepth.append(np.ones(
6667
(ndaysYearLeap,
67-
int(nYearsPool[loopSeason])))
68+
nYears))
6869
*missingDay)
6970
dailyWetState.append(np.ones(
7071
(ndaysYearLeap,
71-
int(nYearsPool[loopSeason])))
72+
nYears))
7273
*stateBad)
7374

7475
#Counter through the year dimension of our arrays

0 commit comments

Comments
 (0)