Mercurial > repos > public > sbplib_julia
changeset 1275:dcd8654ca33b refactor/grids
Remove getcomponent stubs since we might have a cleaner way to solve it with map or lazymap
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 26 Feb 2023 11:53:23 +0100 |
parents | 7fab13c07412 |
children | 75a65db29be1 |
files | grid_refactor.md src/Grids/grid.jl test/Grids/grid_test.jl |
diffstat | 3 files changed, 8 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/grid_refactor.md Sat Feb 25 22:57:00 2023 +0100 +++ b/grid_refactor.md Sun Feb 26 11:53:23 2023 +0100 @@ -119,6 +119,14 @@ end ``` +Could allow us to remove eval_on. + +## Do we need functions like `getcomponent`? +Perhaps this can be more cleanly solved using map or a lazy version of map? +That approach would be more flexible and more general requiring few specialized functions. + +(see "Lazy version of map for our needs?" above) + ## Notes from pluto notebook - Är det dåligt att använda ndims om antalet index inte matchar? - Tex ostrukturerat grid
--- a/src/Grids/grid.jl Sat Feb 25 22:57:00 2023 +0100 +++ b/src/Grids/grid.jl Sun Feb 26 11:53:23 2023 +0100 @@ -62,15 +62,6 @@ end end -""" - getcomponent(gfun, I::Vararg{Int}) - -Return one of the components of gfun as a grid function. -""" -# Should it be lazy? Could it be a view? -function getcomponent(gfun, I::Vararg{Int}) end -# function getcomponent(gfun, s::Symbol) end ? - # TODO: Explain how these are intended to be used _ncomponents(::Type{<:Number}) = 1
--- a/test/Grids/grid_test.jl Sat Feb 25 22:57:00 2023 +0100 +++ b/test/Grids/grid_test.jl Sun Feb 26 11:53:23 2023 +0100 @@ -44,10 +44,6 @@ @test eval_on(g, f) == map(x̄->f(x̄...), g) end -@testset "getcomponent" begin - @test_broken false -end - @testset "_ncomponents" begin @test Grids._ncomponents(Int) == 1 @test Grids._ncomponents(Float64) == 1