@@ -950,16 +950,6 @@ def _arg_check(self, args, intervals, **kwargs):
950950 for i , s in zip (self .dimensions , data .shape , strict = True ):
951951 i ._arg_check (args , s , intervals [i ])
952952
953- if args .options ['index-mode' ] == 'int32' and \
954- args .options ['linearize' ] and \
955- self .is_regular and \
956- data .size - 1 >= np .iinfo (np .int32 ).max :
957- raise InvalidArgument (f"`{ self .name } `, with its { data .size } elements, is too "
958- "big for int32 pointer arithmetic. Consider using the "
959- "'index-mode=int64' option, the save=Buffer(..) "
960- "API (TimeFunction only), or domain "
961- "decomposition via MPI" )
962-
963953 def _arg_finalize (self , args , alias = None ):
964954 key = alias or self
965955 return {key .name : self ._C_make_dataobj (alias = key , ** args )}
@@ -1341,6 +1331,28 @@ def avg(self, p=None, dims=None):
13411331 tot = self .sum (p , dims )
13421332 return tot / len (tot .args )
13431333
1334+ def _arg_check (self , args , intervals , ** kwargs ):
1335+ """
1336+ Check that `args` contains legal runtime values bound to `self`.
1337+
1338+ Raises
1339+ ------
1340+ InvalidArgument
1341+ If an incompatibility is detected.
1342+ """
1343+ data = args [self .name ]
1344+
1345+ if args .options ['index-mode' ] == 'int32' and \
1346+ args .options ['linearize' ] and \
1347+ data .size - 1 >= np .iinfo (np .int32 ).max :
1348+ raise InvalidArgument (f"`{ self .name } `, with its { data .size } elements, is too "
1349+ "big for int32 pointer arithmetic. Consider using the "
1350+ "'index-mode=int64' option, the save=Buffer(..) "
1351+ "API (TimeFunction only), or domain "
1352+ "decomposition via MPI" )
1353+
1354+ return super ()._arg_check (args , intervals , ** kwargs )
1355+
13441356
13451357class TimeFunction (Function ):
13461358
0 commit comments