diff src/Grids/grid.jl @ 1128:dfbd62c7eb09 feature/grids

Rename dim to ndims in Grids.jl
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 05 Oct 2022 22:00:30 +0200
parents aeeffca46b94
children 5f677cd6f0b6
line wrap: on
line diff
--- a/src/Grids/grid.jl	Wed Oct 05 21:26:37 2022 +0200
+++ b/src/Grids/grid.jl	Wed Oct 05 22:00:30 2022 +0200
@@ -2,12 +2,11 @@
      Grid
 
 Should implement
-    dim(grid::Grid)
+    Base.ndims(grid::Grid)
     points(grid::Grid)
 
 """
 abstract type Grid end
-function dim end # TODO: Rename to Base.ndims instead? That's the name used for arrays.
 function points end
 
 """
@@ -15,7 +14,7 @@
 
 A range containing the dimensions of `grid`
 """
-dims(grid::Grid) = 1:dim(grid)
+dims(grid::Grid) = 1:ndims(grid)
 
 """
     evalOn(grid::Grid, f::Function)
@@ -25,4 +24,4 @@
 function evalOn(grid::Grid, f::Function)
     F(x) = f(x...)
     return F.(points(grid))
-end
\ No newline at end of file
+end