Skip to content

Commit

Permalink
modify deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
daanhb committed Nov 18, 2024
1 parent 5bafcd1 commit c1cfd46
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@
@deprecate roots(dict::Dictionary, coef::AbstractVector) expansion_roots(dict, coef)
@deprecate roots(b::OPS) ops_roots(b)

# No longer identify expansions with coefficient vector
@deprecate iterate(e::Expansion) iterate(coefficients(e))
@deprecate iterate(e::Expansion, state) iterate(coefficients(e), state)
import Base: collect
collect(e::Expansion) = error("you didn't!")
# @deprecate collect(e::Expansion) coefficients(e)

# Deprecate the below right away because it conflicts with other ways of computing
# with expansions
# import Base: BroadcastStyle
# @deprecate BroadcastStyle(e::Expansion) Base.Broadcast.DefaultArrayStyle{dimension(e)}()

getindex(e::Expansion, args...) = error("Oh no you did not")
# @deprecate getindex(e::Expansion, args...) getindex(e.coefficients, args...)
@deprecate setindex!(e::Expansion, args...) getindex(e.coefficients, args...)

# support of a dictionary
@deprecate support(dict::Dictionary, idx) dict_support(dict, idx)
@deprecate support(part::Partition, idx) partition_support(part, idx)

@deprecate moment(dict::Dictionary1d, idx; options...) dict_moment(dict, idx; options...)


# No longer identify expansions with coefficient vector
# This functionality was removed in v0.7. For documentation purposes we list deprecations here:

# @deprecate iterate(e::Expansion) iterate(coefficients(e))
# @deprecate iterate(e::Expansion, state) iterate(coefficients(e), state)
# @deprecate collect(e::Expansion) coefficients(e)
# @deprecate getindex(e::Expansion, args...) getindex(e.coefficients, args...)
# @deprecate setindex!(e::Expansion, args...) getindex(e.coefficients, args...)

# import Base: BroadcastStyle
# @deprecate BroadcastStyle(e::Expansion) Base.Broadcast.DefaultArrayStyle{dimension(e)}()

2 comments on commit c1cfd46

@daanhb
Copy link
Member Author

@daanhb daanhb commented on c1cfd46 Nov 19, 2024

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Breaking changes

  • an expansion (dictionary+coefficients) no longer acts as the vector of coefficients. This means it cannot be indexed (as in e[2] returning the second coefficient) and cannot be iterated over
  • there are some interface cleanups. The norm and moment functions with a combination of dictionary and coefficient as arguments are renamed to dict_norm and dict_moment instead. One can still invoke norm on a basisfunction, e.g., norm(dict[3])

Features

  • computing with expansions has improved. For example, computing the diagonal of the Christoffel-Darboux kernel of a polynomial basis can be done as follows:
julia> basis = orthogonalize(Legendre(3))
DiagonalOperator(v) * Legendre(3)

v = 3-element Vector{Float64}:
 0.707107
 1.22474
 1.58114

julia> k = sum(phi^2 for phi in basis)
Expansion(Legendre(5), v)

v = 5-element Vector{Float64}:
 1.5
 8.28036e-16
 1.71429
 1.14325e-15
 1.28571

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

Tagging

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.0 -m "<description of version>" c1cfd463b35c4b1f58665477d2813c64c721211a
git push origin v0.7.0

Please sign in to comment.