Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add SciMLSensitivity tests to downstream CI #337

Merged
merged 6 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
- {user: SciML, repo: OrdinaryDiffEq.jl, group: Core}
- {user: SciML, repo: OrdinaryDiffEq.jl, group: Interface}
- {user: SciML, repo: DelayDiffEq.jl, group: Interface}
- {user: SciML, repo: SciMLSensitivity.jl, group: Core1}
- {user: SciML, repo: SciMLSensitivity.jl, group: Core2}
- {user: SciML, repo: SciMLSensitivity.jl, group: Core3}
- {user: SciML, repo: SciMLSensitivity.jl, group: Core4}
- {user: SciML, repo: SciMLSensitivity.jl, group: Core5}
oscardssmith marked this conversation as resolved.
Show resolved Hide resolved
ChrisRackauckas marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
Expand Down
22 changes: 14 additions & 8 deletions ext/RecursiveArrayToolsZygoteExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,29 @@
@adjoint function Base.Array(VA::AbstractVectorOfArray)
adj = let VA=VA
function Array_adjoint(y)
VA = copy(VA)
VA = recursivecopy(VA)

Check warning on line 113 in ext/RecursiveArrayToolsZygoteExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/RecursiveArrayToolsZygoteExt.jl#L113

Added line #L113 was not covered by tests
copyto!(VA, y)
return (VA,)
end
end
Array(VA), adj
end

@adjoint function Base.view(A::AbstractVectorOfArray, I::Colon...)
function adjoint(y)
(recursivecopy(parent(y)), map(_ -> nothing, I)...)

Check warning on line 123 in ext/RecursiveArrayToolsZygoteExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/RecursiveArrayToolsZygoteExt.jl#L121-L123

Added lines #L121 - L123 were not covered by tests
end
return view(A, I...), adjoint

Check warning on line 125 in ext/RecursiveArrayToolsZygoteExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/RecursiveArrayToolsZygoteExt.jl#L125

Added line #L125 was not covered by tests
end

@adjoint function Base.view(A::AbstractVectorOfArray, I...)
adj = let A = A, I = I
function view_adjoint(y)
A = zero(A)
view(A, I...) .= y
return (A, map(_ -> nothing, I)...)
end
function view_adjoint(y)
A = recursivecopy(parent(y))
recursivefill!(A, zero(eltype(A)))
A[I...] .= y
return (A, map(_ -> nothing, I)...)

Check warning on line 133 in ext/RecursiveArrayToolsZygoteExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/RecursiveArrayToolsZygoteExt.jl#L129-L133

Added lines #L129 - L133 were not covered by tests
end
view(A, I...), adj
view(A, I...), view_adjoint

Check warning on line 135 in ext/RecursiveArrayToolsZygoteExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/RecursiveArrayToolsZygoteExt.jl#L135

Added line #L135 was not covered by tests
end

ChainRulesCore.ProjectTo(a::AbstractVectorOfArray) = ChainRulesCore.ProjectTo{VectorOfArray}((sz = size(a)))
Expand Down
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

function recursivecopy(a::AbstractVectorOfArray)
b = copy(a)
b.u = recursivecopy.(a.u)
b.u .= recursivecopy.(a.u)

Check warning on line 31 in src/utils.jl

View check run for this annotation

Codecov / codecov/patch

src/utils.jl#L31

Added line #L31 was not covered by tests
return b
end

Expand Down
Loading