Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/RecursiveArrayToolsArrayPartitionAnyAll/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ version = "1.0.2"
[deps]
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"

[sources]
RecursiveArrayTools = {path = "../.."}

Comment on lines -8 to -10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, keep sources.

[compat]
Pkg = "1"
RecursiveArrayTools = "4"
Expand Down
4 changes: 3 additions & 1 deletion lib/RecursiveArrayToolsArrayPartitionAnyAll/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using RecursiveArrayTools, RecursiveArrayToolsArrayPartitionAnyAll, Test
using Pkg
Pkg.develop(PackageSpec(path = normpath(joinpath(@__DIR__, "..", "..", ".."))))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this, use sources.


using RecursiveArrayTools, RecursiveArrayToolsArrayPartitionAnyAll, Test

const TEST_GROUP = get(ENV, "RECURSIVEARRAYTOOLS_TEST_GROUP", "Core")

Expand Down
7 changes: 3 additions & 4 deletions lib/RecursiveArrayToolsRaggedArrays/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"

[sources]
RecursiveArrayTools = {path = "../.."}

[compat]
Adapt = "4"
ArrayInterface = "7.17.0"
LinearAlgebra = "1.10"
Pkg = "1"
RecursiveArrayTools = "4"
SparseArrays = "1.10"
StaticArrays = "1.6"
StaticArraysCore = "1.4.2"
SymbolicIndexingInterface = "0.3.42"
Test = "1"
Expand All @@ -28,8 +26,9 @@ julia = "1.10"
[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Pkg", "SparseArrays", "SymbolicIndexingInterface", "Test"]
test = ["Pkg", "SparseArrays", "StaticArrays", "SymbolicIndexingInterface", "Test"]
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ function Base.copyto!(
if ArrayInterface.ismutable(dest.u[i]) || dest.u[i] isa AbstractRaggedVectorOfArray
copyto!(dest.u[i], src.u[j])
else
dest.u[i] = StaticArraysCore.similar_type(dest.u[i])(src.u[j])
dest.u[i] = typeof(dest.u[i])(src.u[j])
end
end
return
Expand All @@ -1334,7 +1334,7 @@ function Base.copyto!(
if ArrayInterface.ismutable(dest.u[i]) || dest.u[i] isa AbstractRaggedVectorOfArray
copyto!(dest.u[i], slice)
else
dest.u[i] = StaticArraysCore.similar_type(dest.u[i])(slice)
dest.u[i] = typeof(dest.u[i])(slice)
end
end
return dest
Expand Down Expand Up @@ -1455,7 +1455,7 @@ function Base.fill!(VA::AbstractRaggedVectorOfArray, x)
fill!(VA[:, i], x)
else
# For immutable arrays like SVector, create a new filled array
VA.u[i] = fill(x, StaticArraysCore.similar_type(VA.u[i]))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StaticArraysCore.similar_type should be allowed.

VA.u[i] = typeof(VA.u[i])(fill(x, size(VA.u[i])))
end
else
VA[:, i] = x
Expand Down Expand Up @@ -1623,7 +1623,7 @@ for (type, N_expr) in [
copyto!(dest[:, i], unpack_voa(bc, i))
else
unpacked = unpack_voa(bc, i)
arr_type = StaticArraysCore.similar_type(dest[:, i])
arr_type = typeof(dest[:, i])
dest[:, i] = if length(unpacked) == 1 && length(dest[:, i]) == 1
arr_type(unpacked[1])
elseif length(unpacked) == 1
Expand Down
11 changes: 1 addition & 10 deletions lib/RecursiveArrayToolsRaggedArrays/test/qa/qa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ run_qa(
),
),
jet_kwargs = (; target_modules = (RecursiveArrayToolsRaggedArrays,)),
# Pre-existing JET typo-mode finding (reproduces byte-identically on master):
# the `copyto!`/`fill!`/broadcast immutable-element branches call
# `StaticArraysCore.similar_type(dest.u[i])`, but `dest.u[i]` infers as `::Any`
# because the abstract `AbstractRaggedVectorOfArray` `.u` field is untyped, so
# `similar_type(::Any)` has no matching method. Tracked (with the real fix —
# tightening the `.u` type / guarding the immutable branch) in
# https://github.com/SciML/RecursiveArrayTools.jl/issues/620. JET 0.9 on Julia
# 1.10 does not report this finding, so keep that stricter lane unbroken.
jet_broken = VERSION >= v"1.11",
ei_kwargs = (;
# Non-public names legitimately qualified/imported from upstream packages
# (Base, Base.Broadcast, StaticArraysCore, ArrayInterface, Adapt,
Expand All @@ -35,7 +26,7 @@ run_qa(
:Slice, :SolvedVariables, :StaticVecOrMat, :SymbolicTypeTrait,
:adapt_structure, :add_sum, :broadcastable, :check_parent_index_match,
:ensure_indexable, :flatten, :front, :index_dimsum, :ismutable,
:issingular, :maybeview, :mul_prod, :similar_type, :tail, :typename,
:issingular, :maybeview, :mul_prod, :tail, :typename,
:unalias, :viewindexing,
),
),
Expand Down
23 changes: 22 additions & 1 deletion lib/RecursiveArrayToolsRaggedArrays/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using Pkg
Pkg.develop(PackageSpec(path = normpath(joinpath(@__DIR__, "..", "..", ".."))))

using RecursiveArrayTools, RecursiveArrayToolsRaggedArrays
using RecursiveArrayToolsRaggedArrays: RaggedEnd, RaggedRange
using SymbolicIndexingInterface
using SymbolicIndexingInterface: SymbolCache
using StaticArrays
using Test
using Pkg

const TEST_GROUP = get(ENV, "RECURSIVEARRAYTOOLS_TEST_GROUP", "Core")

Expand All @@ -25,6 +28,24 @@ end

if TEST_GROUP == "Core" || TEST_GROUP == "All"
@testset "RecursiveArrayToolsRaggedArrays" begin
@testset "immutable inner arrays" begin
src = RaggedVectorOfArray([SVector(1, 2), SVector(3, 4)])
dest = RaggedVectorOfArray([SVector(0, 0), SVector(0, 0)])

copyto!(dest, src)
@test dest.u == src.u
@test eltype(dest.u) === SVector{2, Int}

copyto!(dest, [5 7; 6 8])
@test dest.u == [SVector(5, 6), SVector(7, 8)]

fill!(dest, 9)
@test dest.u == [SVector(9, 9), SVector(9, 9)]

dest .= src .+ 1
@test dest.u == [SVector(2, 3), SVector(4, 5)]
end

# ===================================================================
# Tests ported from v3 basic_indexing.jl
# ===================================================================
Expand Down
3 changes: 0 additions & 3 deletions lib/RecursiveArrayToolsShorthandConstructors/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ version = "1.0.2"
[deps]
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"

[sources]
RecursiveArrayTools = {path = "../.."}

[compat]
Pkg = "1"
RecursiveArrayTools = "4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using RecursiveArrayTools, RecursiveArrayToolsShorthandConstructors, Test
using Pkg
Pkg.develop(PackageSpec(path = normpath(joinpath(@__DIR__, "..", "..", ".."))))

using RecursiveArrayTools, RecursiveArrayToolsShorthandConstructors, Test

const TEST_GROUP = get(ENV, "RECURSIVEARRAYTOOLS_TEST_GROUP", "Core")

Expand Down
3 changes: 0 additions & 3 deletions test/AD/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[sources]
RecursiveArrayTools = {path = "../.."}

[compat]
ForwardDiff = "0.10.38, 1"
Mooncake = "0.5"
Expand Down
4 changes: 0 additions & 4 deletions test/Downstream/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[sources]
RecursiveArrayTools = {path = "../.."}
RecursiveArrayToolsShorthandConstructors = {path = "../../lib/RecursiveArrayToolsShorthandConstructors"}

[compat]
ArrayInterface = "7"
ModelingToolkit = "8.33, 9, 10, 11"
Expand Down
4 changes: 0 additions & 4 deletions test/GPU/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ RecursiveArrayToolsArrayPartitionAnyAll = "172d604e-c495-4f00-97bf-d70957099afa"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[sources]
RecursiveArrayTools = {path = "../.."}
RecursiveArrayToolsArrayPartitionAnyAll = {path = "../../lib/RecursiveArrayToolsArrayPartitionAnyAll"}

[compat]
Adapt = "4"
ArrayInterface = "7.17.0"
Expand Down
3 changes: 0 additions & 3 deletions test/NoPre/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
RecursiveArrayTools = {path = "../.."}

[compat]
JET = "0.9, 0.10, 0.11"
RecursiveArrayTools = "4"
Expand Down
10 changes: 10 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,20 @@ run_tests(;
# second half of both the "SymbolicIndexingInterface" and "Downstream" paths.
"SII_Downstream" => (;
env = joinpath(@__DIR__, "Downstream"),
parent = [
dirname(@__DIR__),
joinpath(dirname(@__DIR__), "lib", "RecursiveArrayToolsShorthandConstructors"),
],
body = function ()
return @time @safetestset "DiffEqArray Indexing Tests" include("Downstream/symbol_indexing.jl")
end,
),
"Downstream" => (;
env = joinpath(@__DIR__, "Downstream"),
parent = [
dirname(@__DIR__),
joinpath(dirname(@__DIR__), "lib", "RecursiveArrayToolsShorthandConstructors"),
],
body = function ()
@time @safetestset "ODE Solve Tests" include("Downstream/odesolve.jl")
@time @safetestset "Event Tests with ArrayPartition" include("Downstream/downstream_events.jl")
Expand All @@ -65,6 +73,7 @@ run_tests(;
),
"NoPre" => (;
env = joinpath(@__DIR__, "NoPre"),
parent = dirname(@__DIR__),
body = function ()
return @time @safetestset "JET Tests" include("NoPre/jet_tests.jl")
end,
Expand All @@ -76,6 +85,7 @@ run_tests(;
# cannot satisfy when it minimizes Julia to the 1.10.0 LTS floor.
"AD" => (;
env = joinpath(@__DIR__, "AD"),
parent = dirname(@__DIR__),
body = function ()
@time @safetestset "Adjoint Tests" include("AD/adjoints.jl")
return @time @safetestset "Mooncake Tests" include("AD/mooncake.jl")
Expand Down
Loading