@@ -1315,6 +1315,34 @@ def test_loose_kwargs(self):
13151315 # But the following should work perfectly fine
13161316 op .arguments (x_size = 2 , y_size = 2 )
13171317
1318+ @pytest .mark .parametrize ('vfact' , [1 , 3 , 4 ])
1319+ def test_apply_args_consitency (self , vfact ):
1320+ nt = 201
1321+ grid = Grid (shape = (11 , 11 , 11 ))
1322+ time = grid .time_dim
1323+
1324+ u = TimeFunction (name = 'u' , grid = grid , time_order = 2 , space_order = 4 )
1325+ rec = SparseTimeFunction (name = 'rec' , grid = grid , npoint = 1 , nt = nt )
1326+
1327+ factor = Constant (name = 'factor' , value = vfact , dtype = np .int32 )
1328+ time_sub = ConditionalDimension (name = 't_sub' , parent = time , factor = factor )
1329+ usave = TimeFunction (name = 'usave' , grid = grid , space_order = 4 , time_order = 0 ,
1330+ save = nt , time_dim = time_sub )
1331+
1332+ eqns = [
1333+ Eq (u .forward , u + 1 ),
1334+ Eq (usave , u ),
1335+ ] + rec .interpolate (expr = u )
1336+
1337+ op = Operator (eqns , opt = 'noop' )
1338+ args0 = op .arguments (time_m = 0 , time_M = nt - 2 )
1339+ args1 = op .arguments (time_m = 0 , time_M = nt - 2 , rec = rec , usave = usave )
1340+
1341+ for k , v in args0 .items ():
1342+ assert k in args1
1343+ if isinstance (v , int ):
1344+ assert args1 [k ] == v
1345+
13181346
13191347@skipif ('device' )
13201348class TestDeclarator :
0 commit comments