Skip to content

Commit 6becdc2

Browse files
authored
fix deprecation of dtc (#380)
* 0.5.19: fix deprecation of `dtc`
1 parent 083c772 commit 6becdc2

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AbstractGPs"
22
uuid = "99985d1d-32ba-4be9-9821-2ec096f28918"
33
authors = ["JuliaGaussianProcesses Team"]
4-
version = "0.5.18"
4+
version = "0.5.19"
55

66
[deps]
77
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/deprecations.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,17 @@
66
plt, gp; samples=n, kwargs...
77
)
88

9-
@deprecate elbo(dtc::DTC, fx, y) approx_log_evidence(dtc, fx, y)
10-
@deprecate dtc(vfe::Union{VFE,DTC}, fx, y) approx_log_evidence(vfe, fx, y)
9+
@deprecate dtc(dtc::DTC, fx, y) approx_log_evidence(dtc, fx, y)
10+
11+
function _warn_elbo_called_with_DTC(dtc::DTC, fx, y)
12+
@warn "`elbo` was called with an object of type `DTC`, but should only be called with the `VFE` type instead"
13+
return elbo(VFE(dtc.fz), fx, y)
14+
end
15+
16+
function _warn_dtc_called_with_VFE(vfe::VFE, fx, y)
17+
@warn "`dtc` was called with an object of type `VFE`, but instead you should call `approx_log_evidence` with an object of type `DTC`"
18+
return approx_log_evidence(DTC(vfe.fz), fx, y)
19+
end
20+
21+
@deprecate elbo(dtc::DTC, fx, y) _warn_elbo_called_with_DTC(dtc, fx, y)
22+
@deprecate dtc(vfe::VFE, fx, y) _warn_dtc_called_with_VFE(vfe, fx, y)

0 commit comments

Comments
 (0)