changeset 2052:a590dc4af7ea feature/sbp_operators/laplace_curvilinear tip

Merge feature/grids/geometry_functions
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 06 Feb 2026 17:35:25 +0100
parents 17efc56f1f45 (current diff) 21925a343989 (diff)
children
files
diffstat 3 files changed, 24 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/grid.jl	Wed Feb 04 10:12:24 2026 +0100
+++ b/src/Grids/grid.jl	Fri Feb 06 17:35:25 2026 +0100
@@ -74,13 +74,13 @@
     end
 end
 
-_array_type(v::ArrayComponentView) = typeof(v)
+_array_type(v::ArrayComponentView) = _array_type(typeof(v))
 _array_type(::Type{ArrayComponentView{CT,T,D,AT,IT}}) where {CT,T,D,AT,IT} = AT
 
 Base.size(cv::ArrayComponentView) = size(cv.v)
 Base.getindex(cv::ArrayComponentView, i::Int) = cv.v[i][cv.component_index...]
 Base.getindex(cv::ArrayComponentView, I::Vararg{Int}) = cv.v[I...][cv.component_index...]
-IndexStyle(ACT::Type{ArrayComponentView}) = IndexStyle(_array_type(ACT))
+Base.IndexStyle(ACT::Type{<:ArrayComponentView}) = IndexStyle(_array_type(ACT))
 
 # TODO: Implement `setindex!`?
 # TODO: Implement a more general ComponentView that can handle non-AbstractArrays.
--- a/test/Grids/grid_test.jl	Wed Feb 04 10:12:24 2026 +0100
+++ b/test/Grids/grid_test.jl	Fri Feb 06 17:35:25 2026 +0100
@@ -114,6 +114,27 @@
         @test ArrayComponentView(v, (1:2, 1:2)) == [@SMatrix[1 4;2 5] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
         @test ArrayComponentView(v, (2:3, 1:2)) == [@SMatrix[2 5;3 6] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
     end
+
+    @testset "size" begin
+        v = [@SMatrix[1 3; 2 4] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
+        cv = ArrayComponentView(v, (1, 1))
+
+        @test size(cv) == (3,4)
+    end
+
+    @testset "IndexStyle" begin
+        v = [@SMatrix[1 3; 2 4] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
+        cv = ArrayComponentView(v, (1, 1))
+
+        @test IndexStyle(cv) == IndexStyle(v)
+    end
+
+    @testset "_array_type" begin
+        v = [@SMatrix[1 3; 2 4] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
+        cv = ArrayComponentView(v, (1, 1))
+
+        @test Grids._array_type(cv) == typeof(v)
+    end
 end
 
 @testset "_ncomponents" begin
--- a/test/runtests.jl	Wed Feb 04 10:12:24 2026 +0100
+++ b/test/runtests.jl	Fri Feb 06 17:35:25 2026 +0100
@@ -65,7 +65,7 @@
 
         log_and_time("code linting using JET.jl") do
             @testset "Code linting (JET.jl)" begin
-                JET.test_package(Diffinitive; target_defined_modules = true)
+                JET.test_package(Diffinitive; target_modules = (Diffinitive,))
             end
         end
     end