Type consistency for ..
Fix #416
Should also improve Float32 support (#415)
Coverage decreased (-0.006%) to 91.123% when pulling 60ece315751dadbf8536ece8cc63831f9c2986c7 on remi-garcia:rg/typeconsistency into a1cbb81223e350a23b6d03f0de9456734b88a982 on JuliaIntervals:master.
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 First, sorry for our long delay to get back to this.
Could you please rebase to master and push again?
I used the GUI "Fetch upstream". I think it went fine.
@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 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.
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.
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.
I dont think it would be breaking, since it is used only internally and is not exported.