Skip to content

Conversation

Kolaru
Copy link
Member

@Kolaru Kolaru commented Oct 6, 2025

This PR enhance the documentation and docstrings related to two things that were discussed during JuliaCon Paris:

  1. Boolean functions always return false on NaI (displayed as ∅_ill). Thanks to @bvrb it was noticed that the doc was unclear about it and that the function docstrings pointed to the wrong part of the standard.
  2. The hash function is an exception to the general rule that all functions are pointwise extension of their Real counterpart. Among other things, this allows the use of intervals as key of dictionnaries (a concerned raised by @LilithHafner)

Fix #734

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.50%. Comparing base (1ace2a0) to head (c7bb37e).
⚠️ Report is 5 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #735      +/-   ##
==========================================
- Coverage   78.27%   76.50%   -1.77%     
==========================================
  Files          31       31              
  Lines        2923     2903      -20     
==========================================
- Hits         2288     2221      -67     
- Misses        635      682      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@OlivierHnt
Copy link
Member

Can we include the display change from ∅_ill to NaI in this PR?

@OlivierHnt
Copy link
Member

The failure of the CI on nightly and 1.12-rc3 are unrelated to the changes of this PR.
See this issue JuliaLang/julia#59756.

@bvrb
Copy link

bvrb commented Oct 6, 2025

It caught my eye that there is a small typo on the following line

This is does not take into consideration the decoration of the interval.

(superfluous is). Since you are already doing the work of changing all these docstrings, might as well change this one as well!

@LilithHafner
Copy link

FYI if you define hash you should also consider defining isequal to avoid this problematic behavior:

julia> d = Dict()
Dict{Any, Any}()

julia> for _ in 1:10
           d[interval(rand(), rand()+1)] = true
       end

julia> for _ in 1:1000
           d[interval(rand(), rand()+1)] = true
       end
ERROR: ArgumentError: `==` is purposely not supported for overlapping non-thin intervals. See instead `isequal_interval`
Stacktrace:
 [1] ==(x::Interval{Float64}, y::Interval{Float64})
   @ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/5MOaW/src/intervals/real_interface.jl:84
 [2] isequal(x::Interval{Float64}, y::Interval{Float64})
   @ Base ./operators.jl:134
 [3] ht_keyindex2_shorthash!(h::Dict{Any, Any}, key::Interval{Float64})
   @ Base ./dict.jl:291
 [4] setindex!(h::Dict{Any, Any}, v::Any, key::Interval{Float64})
   @ Base ./dict.jl:371
 [5] top-level scope
   @ ./REPL[34]:2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isempty_interval return false on empty ill intervals
5 participants