-
Notifications
You must be signed in to change notification settings - Fork 72
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
fixed eltype for interval #496
Conversation
Codecov Report
@@ Coverage Diff @@
## master #496 +/- ##
=======================================
Coverage 91.08% 91.09%
=======================================
Files 25 25
Lines 1783 1785 +2
=======================================
+ Hits 1624 1626 +2
Misses 159 159
Continue to review full report at Codecov.
|
Thanks @lucaferranti for addressing this! I'll try to review this PR tomorrow or over the weekend... sorry, I'm having some very busy days. |
No problem at all Luis! Thanks for looking into this :) |
Maybe add such test? (examples in the linked issues). Apart from that, the proposed changes lgtm 💯 |
Project.toml
Outdated
@@ -1,7 +1,7 @@ | |||
name = "IntervalArithmetic" | |||
uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" | |||
repo = "https://github.com/JuliaIntervals/IntervalArithmetic.jl.git" | |||
version = "0.19.2" | |||
version = "0.19.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this PR introduces a potentially breaking change. (apparently, tests for eltype
were lacking).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for solving this. I have only added a minor comment/suggestion, which is probably not needed...
src/multidim/intervalbox.jl
Outdated
@@ -40,7 +40,7 @@ end | |||
eltype(::Type{IntervalBox{N,T}}) where {N,T} = Interval{T} # Note that this is defined for the type | |||
|
|||
|
|||
Base.eltype(x::IntervalBox{T}) where {T<:Real} = T | |||
Base.eltype(x::IntervalBox{T}) where {T<:Real} = Interval{T} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to what it's done with Interval
, I guess it's a good idea to define numtype
for IntervalBox
es...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right that it can be useful, added it!
I propose to merge #497 first (if possible with tests for the M1 processor), then this one (it may need a rebase), and finally register the new version. |
Agreed! It's a good idea |
Description
changed
eltype
so that noweltype(1..2)
returnsInterval{Float64}
instead ofFloat64
. This was causing issues when doing e.g. matrix*interval multiplication.Since a function doing what eltype was doing before can be useful, I added
numtype
to do that. Happy to use another name if you don't like itBefore
After
Related issues
eltype
should return the fullInterval
type (?) #487