Compat.jl icon indicating copy to clipboard operation
Compat.jl copied to clipboard

logrange

Open mcabbott opened this issue 1 year ago • 5 comments

This adds https://github.com/JuliaLang/julia/pull/39071

Note that:

  • ~~The version check may need to change once backported to 1.11 branch~~
  • Before Julia 1.9, it won't use TwicePrecision, as the necessary log/exp functions aren't defined. The result is slightly worse floating point accuracy.
  • It doesn't print the same way, since there's a big messy print_range function (for LinRange) whose signature the PR widened.
  • ~~The docstrings don't show up in REPL help, I don't know why. Maybe that's true of all functions here. It means you can't see the notes about the above points.~~
julia> logrange(1, 4, length=5)
5-element Compat.LogRange{Float64, Float64}:
 1.0
 1.414213562373095
 2.0
 2.82842712474619
 4.0

help?> logrange
search: logrange

  No documentation found.

  Compat.logrange is a Function.

  # 2 methods for generic function "logrange":
  [1] logrange(start::Real, stop::Real; length) in Compat at /Users/me/.julia/dev/Compat/src/Compat.jl:832
  [2] logrange(start::Real, stop::Real, length::Integer) in Compat at /Users/me/.julia/dev/Compat/src/Compat.jl:831

help?> Compat.LogRange
  No documentation found.

  Compat.LogRange is of type UnionAll.

  Summary
  ≡≡≡≡≡≡≡≡≡

  struct UnionAll <: Type{T}

julia> VERSION
v"1.6.0"

mcabbott avatar Feb 17 '24 21:02 mcabbott

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.71%. Comparing base (82d1848) to head (6f5ee40). Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #821      +/-   ##
==========================================
+ Coverage   92.65%   93.71%   +1.06%     
==========================================
  Files           2        2              
  Lines         354      414      +60     
==========================================
+ Hits          328      388      +60     
  Misses         26       26              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 17 '24 21:02 codecov[bot]

I don't have the energy/enthusiasm to review this PR. Feel free to proceed without me.

LilithHafner avatar Feb 18 '24 19:02 LilithHafner

The docstrings don't show up in REPL help, I don't know why. Maybe that's true of all functions here. It means you can't see the notes about the above points.

I think that's because they are inside the if, not at top level, so need an explicit @doc.

martinholters avatar Feb 21 '24 07:02 martinholters

so need an eplicit @doc.

I've added this to all docstrings in the package, since none worked before. (Could be a separate PR but that's more hassle.)

mcabbott avatar Feb 21 '24 15:02 mcabbott

If you include a version bump in Project.toml, we can tag a new version immediately after merge. Otherwise seems good to go.

martinholters avatar Feb 23 '24 13:02 martinholters