Skip to content

Commit 8ec1d35

Browse files
authored
Transition to noisy depwarn for abs2 (#180)
This is part of the plan for changing the value returned by `abs2`. This stage is designed to catch user-level scripts which may not run with `--depwarn=yes`.
1 parent 2327432 commit 8ec1d35

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ColorVectorSpace"
22
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
3-
version = "0.9.8"
3+
version = "0.9.9"
44

55
[deps]
66
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ We anticipate the following transition schedule:
140140
- Sept 21, 2021: release ColorVectorSpace 0.9.7 with both `abs2` and `Future.abs2`.
141141
`abs2` will have a "quiet" deprecation warning (visible with `--depwarn=yes`
142142
or when running `Pkg.test`)
143-
- Jan 1, 2022: make the deprecation warning "noisy" (cannot be turned off).
143+
- May 19, 2022: make the deprecation warning "noisy" (cannot be turned off).
144144
This is designed to catch user-level scripts that may need to update thresholds
145145
or other constants.
146-
- *Apr 1, 2022: transition `abs2` to the new definition
146+
- *July 1, 2022: transition `abs2` to the new definition
147147
and make `Future.abs2` give a "noisy" depwarn to revert to regular `abs2`.
148-
- *July 1, 2022: remove `Future.abs2`.
148+
- *Dec 1, 2022: remove `Future.abs2`.
149149

150150
The two marked with `*` denote breaking releases.

src/ColorVectorSpace.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ export RGBRGB, complement, nan, dotc, dot, ⋅, hadamard, ⊙, tensor, ⊗, norm
3131

3232
MathTypes{T,C<:Union{AbstractGray{T},AbstractRGB{T}}} = Union{C,TransparentColor{C,T}}
3333

34+
if Base.VERSION >= v"1.5"
35+
@inline _depwarn(msg, funcsym; force=false) = Base.depwarn(msg, funcsym; force=force)
36+
else
37+
@inline _depwarn(msg, funcsym; force=false) = Base.depwarn(msg, funcsym)
38+
end
39+
3440
## Version compatibility with ColorTypes
3541
### TODO: Remove the definitons other than `one` when dropping ColorTypes v0.10 support
3642

@@ -487,7 +493,7 @@ Base.length(r::StepRange{<:AbstractGray}) = length(StepRange(gray
487493

488494
Base.abs2(g::AbstractGray) = abs2(gray(g))
489495
function Base.abs2(c::AbstractRGB)
490-
Base.depwarn("""
496+
_depwarn("""
491497
The return value of `abs2` will change to ensure that `abs2(g::Gray) ≈ abs2(RGB(g::Gray))`.
492498
For `RGB` colors, this results in dividing the previous output by 3.
493499

0 commit comments

Comments
 (0)