-
Notifications
You must be signed in to change notification settings - Fork 71
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
Beta 0.22 #593
Beta 0.22 #593
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #593 +/- ##
==========================================
- Coverage 84.06% 83.01% -1.05%
==========================================
Files 26 23 -3
Lines 1970 2072 +102
==========================================
+ Hits 1656 1720 +64
- Misses 314 352 +38 ☔ View full report in Codecov by Sentry. |
It seems that there is still more work to be done to have better ForwardDiff.jl compatibility. I have added a few broken tests to keep track of this a little. For instance, On the other hand, ForwardDiff seems to rely on Interval{T}(x) where {T<:NumTypes} = convert(Interval{T}, x) |
Looks again like a giant PR is coming 😄 (or 🥲 ? )... Thanks again for the enourmous effort. Few comments (note that apriori I do not opose to the changes):
|
Mhm julia> @time IntervalArithmetic.atomic(Float64, 1)
0.000029 seconds (14 allocations: 644 bytes)
[1.0, 1.0]_com EDIT: with the last commit, this is down to 8 allocations (300 bytes); there is still room for improvement. |
Just noticed the following (which relies on Base methods!): julia> a = interval(-1, 1)
Interval{Float64}(-1.0, 1.0, com)
julia> b = complex(a, a)
Interval{Float64}(-1.0, 1.0, com) + Interval{Float64}(-1.0, 1.0, com)im
julia> zero(a) # OK
Interval{Float64}(0.0, 0.0, com)
julia> zero(b) # Result is ok, except perhaps for the NG (due to using a method from Base)
Interval{Float64}(0.0, 0.0, com, NG) + Interval{Float64}(0.0, 0.0, com, NG)im
julia> @which zero(b)
zero(x::Number)
@ Base number.jl:308 Maybe we should open a new issue with the most basic operations we want to have for |
I added a specialised method for We should perhaps merge this PR and release 0.22? This will allow us getting more feedback from downstream packages during December. |
Please go ahead! I fully agree merging this PR and releasing v0.22 will allow us to check everything more reliably. Great work! |
With all the progress made recently, we should be a few commits away from releasing 0.22! If everything goes well, this should be the last version before the 1.0 release 🥳!
Changes
sup(Inf) = NaN
(Inf
is first converted into anInterval
), previous behavioursup(Inf) == Inf
DiffRules
as a weak dependency and hook intoDiffRules._abs_deriv
for decorated intervals (closes Derivative of abs(::Interval) #564)mince!
function (in-placemince
) (closes Mince should return an iterator #431, closes PR#587)nthroot
torootn
, andnthpow
topown
. It reads better and is consistent with the standard.isinterior
method (closes How should strict enclosure of interval boxes be defined? #490):standard
to:infsup
, feels more consistent with the other format name:midpoint
atomic
since it is an unused internal constructor (see also Make decorated interval the default #590 (comment))bisect
for atomic and empty intervals (closes Bisection should ignore atomic intervals #84)setdiff_interval
tointeriordiff
, it was a misleading name since the function is not quite the "set difference", rather it removes the interior of the second argument from the first. For instancex = interval(1, 3)
,y = interval(2, 4)
, the true set difference should not contain2
; due to the fact that all intervals are closed intervals (unless the inf or sup is unbounded) we can never truly represent the set differenceInterval
s? #476)rand
method is overloaded in IntervalArithmetic.jl, but it is not doing the right thing. Fixing it appears more tricky than initially thought, see e.g. https://discourse.julialang.org/t/output-distribution-of-rand-float32-and-rand-float64-thread-2/105184/12. Fortunately, I believe the package Distributions.jl already looks into such featuresTo do:
To do list (perhaps not necessary for 0.22):
Complex{<:Interval}
(cf. Broken functions for complex intervals #41)Some thoughts on naming convention
I would like to take this opportunity to review once more the name changes that have occurred since 0.20. One big change is that we decided to not overload Base boolean functions (e.g.
==
,issubset
, etc.) to prevent silent errors. We have appended the suffix_interval
to distinguish the functions (e.g.issubset_interval
vsissubset
from Base).Tim Holy's naming convention in ThickNumbers.jl, is to use the suffix
tn
as a short form of "thick number". Perhaps we want to use something similar to have shorter function names, e.g. the suffix_itl
(short for "interval") to replace_interval
.Post-scriptum
Should bisect at any other point than 0.5 work for unbounded intervals?