Closed hyrodium closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
7fa91e1
) 73.94% compared to head (6df6d2a
) 73.94%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks!
Don't know what these 'doctests' are...
https://github.com/JuliaGraphics/Luxor.jl/actions/runs/7948031755/job/21697557018#step:6:12
Hmm, it should be fixed by this line..
I'll take a look.
Ah, that was because of these lines in ci.yml
:
I'll open a PR with julia-docdeploy workflow.
Cool, thanks. To be honest, I thought you were just going to add a deprecation for a Point method ready for a 3.9 release - there seem to be many more changes happening now 🤔
Sorry for not having enough explanation!
I initially thought we could just deprecate and remove methods such as +(::Point, ::Number)
, but that was NOT true. Removing the method breaks broadcasting such as Point(1,2) .+ 3
, and I needed to rewrite the entire broadcasting system (#294). That resulted breaking code like rule.(between.(O - (250, 0), O + (250, 0), 0:0.01:1), -Ï€/3)
.
There are three possibilities for this situation.
Ref
calls.rule.(between.(O - (250, 0), O + (250, 0), 0:0.01:1), -Ï€/3)
working.
Ref
in norm.(Ref([1,2]), 2:3)
)Base.broadcastable(x::Point) = Ref(x)
and removing methods like +(::Point, ::Number)
.+(::Point, ::Number)
and broadcasting.
Ref
may be troublesome and could conflict with Luxor's simplicity.My first question: Is it okay to keep the first one?
I initially thought we need just deprecations for methods like +(::Point, ::Number)
, but we now also need deprecations for broadcasting such as rule.(between.(O - (250, 0), O + (250, 0), 0:0.01:1), -Ï€/3)
. Releasing v3.9.0
with the following properties would be hard or impossible (as discussed in the second bullet in the previous section).
Point(1,2) + 3
etc. working, and add deprecations to that.Point(1,2) .+ 3
etc. working, and avoid warnings to that.rule.(between.(O - (250, 0), O + (250, 0), 0:0.01:1), -Ï€/3)
working, and add deprecations to that.rule.(between.(Ref(O - (250, 0)), Ref(O + (250, 0)), 0:0.01:1), -Ï€/3)
working, and avoid warnings to that.My second question: Is it acceptable to avoid releasing v3.9.0
? If not, what kind of deprecations should I add?
Luxor.jl v4 breaks code like rule.(between.(O - (250, 0), O + (250, 0), 0:0.01:1), -Ï€/3)
, so I'm trying updating all docs code with code blocks (@repl
and @example
) and generated PNG/SVG files. (i.e. we can remove image files such as https://github.com/JuliaGraphics/Luxor.jl/blob/master/docs/src/assets/figures/drawing_on_images.png from the default branch!)
I'm also working on https://github.com/JuliaDocs/Documenter.jl/pull/2452, and I would like to keep Luxor.jl in the list.
Automatically generated images by Luxor in the docs are definitely good example, so woking with @repl
and @example
blocks is beneficial for this too.
My third question: Do we hurry for the next release? Updating the docs may take time a bit.
Although I personally think the Ref syntax is unintuitive and ugly, but if it’s more correct to remove it than to keep it I won’t argue… 😀 People complain loudly about correctness so let’s not give them anything to complain about. (I may add a new function that does what I want 😂)
I don’t think the example page in the Documenter docs is worth worrying about. Luxor was a very early entry, but now there are thousands - including the official Julia docs. I think that the section could be removed.
I think we can release v4 without adding deprecations to an existing release ? That’s what I’d do. 🤔
You’ve taken on a lot of work - thank you - take your time!
Thank you for the reply!
People complain loudly about correctness so let’s not give them anything to complain about.
Exactly :joy::joy:
I think we can release v4 without adding deprecations to an existing release ? That’s what I’d do. 🤔
Agreed! Let's release v4.0.0 after updating the docs!
Although I personally think the Ref syntax is unintuitive and ugly, but if it’s more correct to remove it than to keep it I won’t argue…
I found another fourth possibility for the issue. Prohibiting Point(1,2) .+ 1
and accepting rule.(between.(O - (250, 0), O + (250, 0), 0:0.01:1), -Ï€/3)
. This is a similar approach to String
.
julia> getindex.("abc", 2:3) # Do not need `Ref` to `"abc"`
2-element Vector{Char}:
'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase)
'c': ASCII/Unicode U+0063 (category Ll: Letter, lowercase)
julia> "abc" .+ 1 # Do not return `"bcd"`. Note that `['a', 'b', 'c'] .+ 1 == ['b', 'c', 'd']`
ERROR: MethodError: no method matching +(::String, ::Int64)
Closest candidates are:
+(::Any, ::Any, ::Any, ::Any...)
@ Base operators.jl:587
+(::Base.CoreLogging.LogLevel, ::Integer)
@ Base logging.jl:131
+(::Complex{Bool}, ::Real)
@ Base complex.jl:320
...
So, my current question is which one of these codes can be dropped?
rule.(between.(O - (250, 0), O + (250, 0), 0:0.01:1), -Ï€/3)
Ref
to avoid errors.Point(1,2) .+ 3
Point(1,2) + Point(3,3)
Point(1,2) .^ 3
will be more complicated, but that should not be a common use case.I really don't have much preference about this, but I think we need to reconsider the interface before releasing v4.
I can understand that 'Point(1,2) .+ 3
' (https://github.com/JuliaGraphics/Luxor.jl/issues/270) is a valid concern, and it might be the cause of some misunderstandings, so perhaps it should not be available.
Also I think It's easy to add methods that avoid broadcasting. For example these are easy to add and easier to understand than the Ref
versions:
function between(pt1::Point, pt2::Point, r::Real)
function between(pt1::Point, pt2::Point, r::AbstractRange)
function between(pt1::Point, pt2::Point, a::AbstractArray)
Sorry for the late response. I now think we should drop support for Point(1,2) .+ 3
.
I will open a PR for that this weekend!
jldoctest
docs/make.jl
format (indent etc.)