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

Type consistency for ..

Open remi-garcia opened this issue 5 years ago • 10 comments

Fix #416

remi-garcia avatar Sep 23 '20 06:09 remi-garcia

Should also improve Float32 support (#415)

remi-garcia avatar Sep 23 '20 06:09 remi-garcia

Coverage Status

Coverage decreased (-0.006%) to 91.123% when pulling 60ece315751dadbf8536ece8cc63831f9c2986c7 on remi-garcia:rg/typeconsistency into a1cbb81223e350a23b6d03f0de9456734b88a982 on JuliaIntervals:master.

coveralls avatar Sep 23 '20 07:09 coveralls

As @dpsanders suggested, in the last commit promote_type is preferred over multiple methods.

I also corrected two Interval that, I think, should have been interval.

remi-garcia avatar Sep 28 '20 06:09 remi-garcia

@remi-garcia First, sorry for our long delay to get back to this.

Could you please rebase to master and push again?

lbenet avatar Dec 14 '21 20:12 lbenet

I used the GUI "Fetch upstream". I think it went fine.

remi-garcia avatar Jan 06 '22 12:01 remi-garcia

@test_logs (:warn,) @test isempty(force_interval(NaN, 3))

this is the test causing problem. Using Interval causes problem with invalid input (either bound is NaN).

cc @lbenet

lucaferranti avatar Jan 06 '22 16:01 lucaferranti

@lucaferranti is right; replacing force_interval by Interval in that specific test yields an error; using interval in that case is fine, because it returns the empty interval; this was done #461.

I think force_interval is some left-over, which we replaced by the current behavior of Interval that does not check the correctness of the interval. Then, we can delete that function altogether and replace it simply by Interval when needed. The corresponding tests could also be deleted, since they test essentially the constructors.

lbenet avatar Jan 06 '22 18:01 lbenet

I think it is fine to remove force_interval altogether but it would be breaking, since force_interval reorder the bounds to make it valid when needed, something Interval (rightully) never does.

So we would be removing one feature.

Kolaru avatar Jan 07 '22 01:01 Kolaru

Good point! The reason I proposed to remove it (overlooking that it reorders the bounds to make it a proper interval) is because it is only used to construct IntervalBoxes from arrays, and it is not exported. I do not know what would be the impact of that. In any case, we can keep it, correct the problematic test, and eventually consider if we want such feaure.

lbenet avatar Jan 07 '22 01:01 lbenet

I dont think it would be breaking, since it is used only internally and is not exported.

lucaferranti avatar Jan 07 '22 07:01 lucaferranti