changeset 1512:7476877c0b0e refactor/component_type

Improve docstring for component_view
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 21 Mar 2024 08:00:05 +0100
parents d50ea06813d5
children b6f6425e34ac
files src/Grids/grid.jl
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/grid.jl	Thu Mar 21 07:59:53 2024 +0100
+++ b/src/Grids/grid.jl	Thu Mar 21 08:00:05 2024 +0100
@@ -33,9 +33,17 @@
 coordinate_size(g::Grid) = coordinate_size(typeof(g)) # TBD: Name of this function?!
 
 """
-    component_type(g)
+    component_type(gf)
+
+The type of the components of the elements of `gf`. I.e if `gf` is a vector
+valued grid function, `component_view(gf)` is the element type of the vectors
+at each grid point.
 
-The type of the components of the coordinate vector of `Grid` `g`.
+# Examples
+```julia-repl
+julia> component_type([[1,2], [2,3], [3,4]])
+Int64
+```
 """
 component_type(T::Type) = eltype(eltype(T))
 component_type(t) = component_type(typeof(t))