@@ -449,7 +449,10 @@ def calc_mean_grain_size(p, s):
449449 D_mean [yi , xi ] = np .sum (diameters * weights )
450450 return D_mean
451451
452- # @njit(cache=True) this function is an orchestrator njit will not be faster
452+ # Note: @njit(cache=True) is intentionally not used here.
453+ # This function acts as an orchestrator, delegating work to Numba-compiled helper functions.
454+ # Decorating the orchestrator itself with njit provides no performance benefit,
455+ # since most of the computation is already handled by optimized Numba functions.
453456def sweep (Ct , Cu , mass , dt , Ts , ds , dn , us , un , w ):
454457
455458
@@ -506,7 +509,7 @@ def sweep(Ct, Cu, mass, dt, Ts, ds, dn, us, un, w):
506509 ufn [0 ,:,:] = (ufn [0 ,:,:]+ ufn [- 1 ,:,:])/ 2
507510 ufn [- 1 ,:,:] = ufn [0 ,:,:]
508511
509- # now make sure that there is no gradients at the bondaries
512+ # now make sure that there is no gradients at the boundaries
510513 ufs [:,1 ,:] = ufs [:,0 ,:]
511514 ufs [:,- 2 ,:] = ufs [:,- 1 ,:]
512515 ufs [1 ,:,:] = ufs [0 ,:,:]
@@ -549,7 +552,7 @@ def sweep(Ct, Cu, mass, dt, Ts, ds, dn, us, un, w):
549552 Ct [:,0 ,0 ],Ct [:,- 1 ,0 ] = np .mean (Ct [:,- 2 ,0 ]), np .mean (Ct [:,1 ,0 ])
550553
551554 # Track visited cells and quadrant classification
552- visited = np .zeros (Cu .shape [:2 ], dtype = np . bool_ )
555+ visited = np .zeros (Cu .shape [:2 ], dtype = bool )
553556 quad = np .zeros (Cu .shape [:2 ], dtype = np .uint8 )
554557
555558 ########################################################################################
0 commit comments