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

change deprecation to avoid export #473

Merged
merged 3 commits into from
Feb 23, 2023
Merged
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
Expand Up @@ -2,7 +2,7 @@ name = "Polynomials"
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
license = "MIT"
author = "JuliaMath"
version = "3.2.4"
version = "3.2.5"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
7 changes: 6 additions & 1 deletion src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,12 @@ has a nonzero coefficient. The degree of the zero polynomial is defined to be -1
"""
degree(p::AbstractPolynomial) = iszero(coeffs(p)) ? -1 : length(coeffs(p)) - 1 + min(0, minimumexponent(p))

@deprecate order degree true
function order(p::AbstractPolynomial)
Base.depwarn("The `order` function is deprecated. Use `degree`.",
:AbstractPolynomial)
degree(p)
end
Comment on lines +637 to +641
Copy link
Contributor

Choose a reason for hiding this comment

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

@deprecate order degree false?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks again! Most appreciated. #474 incorporates the suggestion.



"""
Polynomials.domain(::Type{<:AbstractPolynomial})
Expand Down
1 change: 0 additions & 1 deletion test/ChebyshevT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
@test p.coeffs == coeff
@test coeffs(p) == coeff
@test degree(p) == length(coeff) - 1
@test (@test_deprecated order(p)) == length(coeff) - 1
@test Polynomials.indeterminate(p) == :x
@test length(p) == length(coeff)
@test size(p) == size(coeff)
Expand Down
8 changes: 8 additions & 0 deletions test/StandardBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ Base.getindex(z::ZVector, I::Int) = parent(z)[I + z.offset]
@test Polynomials.isconstant(P(1))
@test !Polynomials.isconstant(variable(P))
end

## issue #457
if VERSION >= v"1.7.0"
p = Polynomial([1,2,3])
@test_warn "deprecated" Polynomials.order(p)
@test Polynomials.order(p) == 2
end

end

@testset "Non-number type" begin
Expand Down