Skip to content

Commit

Permalink
Remove More Dead Code (#220)
Browse files Browse the repository at this point in the history
* Bump patch

* Remove more dead code
  • Loading branch information
willtebbutt authored Dec 28, 2021
1 parent f31a495 commit 2510d49
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Stheno"
uuid = "8188c328-b5d6-583d-959b-9690869a5511"
version = "0.7.17"
version = "0.7.18"

[deps]
AbstractGPs = "99985d1d-32ba-4be9-9821-2ec096f28918"
Expand Down
2 changes: 1 addition & 1 deletion src/Stheno.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module Stheno
# Various bits of utility that aren't inherently GP-related. Often very type-piratic.
include(joinpath("util", "zygote_rules.jl"))
include(joinpath("util", "covariance_matrices.jl"))
include(joinpath("util", "dense.jl"))
include(joinpath("util", "block_arrays.jl"))
include(joinpath("util", "abstract_data_set.jl"))
include(joinpath("util", "proper_type_piracy.jl"))

Expand Down
25 changes: 25 additions & 0 deletions src/util/block_arrays.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file contains a number of additions to BlockArrays.jl. These are completely
# independent of Stheno.jl, and will (hopefully) move over to BlockArrays.jl at some point.

function ChainRulesCore.rrule(::typeof(BlockArrays.mortar), _blocks::AbstractArray)
y = BlockArrays.mortar(_blocks)
Ty = typeof(y)
function mortar_pullback::Tangent)
return (NoTangent(), Δ.blocks)
end
function mortar_pullback::BlockArray)
return mortar_pullback(Tangent{Ty}(; blocks = Δ.blocks, axes=NoTangent()))
end
return y, mortar_pullback
end

# A hook to which I can attach an rrule without commiting type-piracy against BlockArrays.
_collect(X::BlockArray) = Array(X)

function ChainRulesCore.rrule(::typeof(_collect), X::BlockArray)
function Array_pullback::Array)
ΔX = Tangent{Any}(blocks=BlockArray(Δ, axes(X)).blocks, axes=NoTangent())
return (NoTangent(), ΔX)
end
return Array(X), Array_pullback
end
50 changes: 0 additions & 50 deletions src/util/dense.jl

This file was deleted.

5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ using Stheno:
diag_At_A,
diag_At_B,
diag_Xt_invA_X,
diag_Xt_invA_Y,
blocksizes
diag_Xt_invA_Y

using Stheno.AbstractGPs.TestUtils: test_internal_abstractgps_interface
using Stheno.AbstractGPs.Distributions: MvNormal
Expand All @@ -55,7 +54,7 @@ include("test_util.jl")
@timedtestset "util" begin
include(joinpath("util", "zygote_rules.jl"))
include(joinpath("util", "covariance_matrices.jl"))
include(joinpath("util", "dense.jl"))
include(joinpath("util", "block_arrays.jl"))
include(joinpath("util", "abstract_data_set.jl"))
end

Expand Down
File renamed without changes.

2 comments on commit 2510d49

@willtebbutt
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/51324

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.18 -m "<description of version>" 2510d49589a6c2a37ffeae70dbf55bbd2d3754c9
git push origin v0.7.18

Please sign in to comment.