From c97a043a4be384f531ae948e81b93467187bea99 Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Thu, 11 Apr 2024 15:45:43 +0100 Subject: [PATCH] Support numpy 2.0 --- pyop2/codegen/representation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyop2/codegen/representation.py b/pyop2/codegen/representation.py index 285525078..5277094d9 100644 --- a/pyop2/codegen/representation.py +++ b/pyop2/codegen/representation.py @@ -285,7 +285,7 @@ def __init__(self, a, b): @cached_property def dtype(self): a, b = self.children - return numpy.find_common_type([], [a.dtype, b.dtype]) + return numpy.result_type(a.dtype, b.dtype) class Sum(Scalar): @@ -299,7 +299,7 @@ def __init__(self, a, b): @cached_property def dtype(self): a, b = self.children - return numpy.find_common_type([], [a.dtype, b.dtype]) + return numpy.result_type(a.dtype, b.dtype) class Product(Scalar): @@ -313,7 +313,7 @@ def __init__(self, a, b): @cached_property def dtype(self): a, b = self.children - return numpy.find_common_type([], [a.dtype, b.dtype]) + return numpy.result_type(a.dtype, b.dtype) class QuotientBase(Scalar): @@ -327,7 +327,7 @@ def __init__(self, a, b): @cached_property def dtype(self): a, b = self.children - return numpy.find_common_type([], [a.dtype, b.dtype]) + return numpy.result_type(a.dtype, b.dtype) class Quotient(QuotientBase):