We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 336b993 commit 65c40c6Copy full SHA for 65c40c6
dedalus/core/basis.py
@@ -3940,7 +3940,11 @@ def local_grids(self, scales=None):
3940
def global_grid_spacing(self, axis, scales=None):
3941
"""Global grids spacings."""
3942
if scales is None: scales = (1,1,1)
3943
- return np.gradient(self.global_grids(scales=scales)[axis], axis=axis, edge_order=2)
+ grid = self.global_grids(scales=scales)[axis]
3944
+ if grid.size == 1:
3945
+ return np.array([np.inf,], dtype=grid.dtype)
3946
+ else:
3947
+ return np.gradient(grid, axis=axis, edge_order=2)
3948
3949
@CachedMethod
3950
def local_grid_spacing(self, axis, scales=None):
0 commit comments