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

deprecate TransformedLogDensity #91

Closed
wants to merge 1 commit into from
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LogDensityProblems"
uuid = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
authors = ["Tamas K. Papp <[email protected]>"]
version = "0.12.0"
version = "0.12.1"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
2 changes: 2 additions & 0 deletions src/LogDensityProblems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ struct TransformedLogDensity{T <: TransformVariables.AbstractTransform, L}
log_density_function::L
end

Base.@deprecate_moved TransformedLogDensity "TransformedLogDensities.TransformedLogDensity"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think one should just state the package name here:

Suggested change
Base.@deprecate_moved TransformedLogDensity "TransformedLogDensities.TransformedLogDensity"
Base.@deprecate_moved TransformedLogDensity "TransformedLogDensities"

If I understand correctly, one should also remove all occurrences of TransformedLogDensity (and probably all traits for it) since otherwise the deprecation doesn't show up but is "overridden" by the type definition. Users will then see a deprecation warning that points them towards installing and loading TransformedLogDensities.

The macro also exports TransformedLogDensity automatically, so it could be removed from the exports. Similarly, I think the dependency on TransformVariables could be removed.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good point, doing that in #89 then.


function Base.show(io::IO, ℓ::TransformedLogDensity)
print(io, "TransformedLogDensity of dimension $(dimension(ℓ))")
end
Expand Down