Skip to content

Commit

Permalink
fix deprecation of dtc (#380)
Browse files Browse the repository at this point in the history
* 0.5.19: fix deprecation of `dtc`
  • Loading branch information
st-- authored Sep 25, 2023
1 parent 083c772 commit 6becdc2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AbstractGPs"
uuid = "99985d1d-32ba-4be9-9821-2ec096f28918"
authors = ["JuliaGaussianProcesses Team"]
version = "0.5.18"
version = "0.5.19"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
16 changes: 14 additions & 2 deletions src/deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,17 @@
plt, gp; samples=n, kwargs...
)

@deprecate elbo(dtc::DTC, fx, y) approx_log_evidence(dtc, fx, y)
@deprecate dtc(vfe::Union{VFE,DTC}, fx, y) approx_log_evidence(vfe, fx, y)
@deprecate dtc(dtc::DTC, fx, y) approx_log_evidence(dtc, fx, y)

function _warn_elbo_called_with_DTC(dtc::DTC, fx, y)
@warn "`elbo` was called with an object of type `DTC`, but should only be called with the `VFE` type instead"
return elbo(VFE(dtc.fz), fx, y)
end

function _warn_dtc_called_with_VFE(vfe::VFE, fx, y)
@warn "`dtc` was called with an object of type `VFE`, but instead you should call `approx_log_evidence` with an object of type `DTC`"
return approx_log_evidence(DTC(vfe.fz), fx, y)
end

@deprecate elbo(dtc::DTC, fx, y) _warn_elbo_called_with_DTC(dtc, fx, y)
@deprecate dtc(vfe::VFE, fx, y) _warn_dtc_called_with_VFE(vfe, fx, y)

2 comments on commit 6becdc2

@st--
Copy link
Member Author

@st-- st-- commented on 6becdc2 Sep 25, 2023

Choose a reason for hiding this comment

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

@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/92187

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.5.19 -m "<description of version>" 6becdc266bf58ae93a68db9977367acf51671e78
git push origin v0.5.19

Please sign in to comment.