Skip to content

Commit 57013b6

Browse files
committed
Fix crash with numpy 2.0
Replace `numpy.cast` with `numpy.asarray` which seems to be available in `numpy` 1.X as well. Closes: singularity#346
1 parent 083f8f6 commit 57013b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

singularity/code/buyable.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ def calculate_work(self, cash_available, cpu_available, time=0):
194194
# And apply it.
195195
was_complete = self.cost_paid
196196
cost_paid = numpy.maximum(
197-
numpy.cast[int64](numpy.round(raw_paid)), was_complete
197+
numpy.asarray(numpy.round(raw_paid), dtype=int64),
198+
was_complete,
198199
)
199200
spent = cost_paid - was_complete
200201
return spent, cost_paid

0 commit comments

Comments
 (0)