-
Notifications
You must be signed in to change notification settings - Fork 33
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
#1699 - Add benchmark mode #1732
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sounds good, maybe after a first round of testing in Reachability + LazySets, to validate if it is worth the effort to create the package. |
mforets
reviewed
Sep 25, 2019
I managed to synchronize the setting for all submodules. I think this is better. julia> Hyperplane([0.], 1.)
ERROR: AssertionError: a hyperplane needs a non-zero normal vector
Stacktrace:
[1] macro expansion at .julia/dev/LazySets/src/Assertions/Assertions.jl:27 [inlined]
[2] Hyperplane{Float64}(::Array{Float64,1}, ::Float64) at .julia/dev/LazySets/src/Sets/Hyperplane.jl:32
[3] Hyperplane(::Array{Float64,1}, ::Float64) at .julia/dev/LazySets/src/Sets/Hyperplane.jl:38
[4] top-level scope at REPL[2]:1
julia> underapproximate(rand(Interval), BoxDirections(2))
ERROR: AssertionError: $(Expr(:escape, :(LazySets.dim(X) == LazySets.dim(dirs))))
Stacktrace:
[1] macro expansion at .julia/dev/LazySets/src/Assertions/Assertions.jl:27 [inlined]
[2] #underapproximate#17(::Bool, ::typeof(underapproximate), ::Interval{Float64,IntervalArithmetic.Interval{Float64}}, ::BoxDirections{Float64}) at .julia/dev/LazySets/src/Approximations/underapproximate.jl:20
[3] underapproximate(::Interval{Float64,IntervalArithmetic.Interval{Float64}}, ::BoxDirections{Float64}) at .julia/dev/LazySets/src/Approximations/underapproximate.jl:20
[4] top-level scope at REPL[3]:1
julia> deactivate_assertions()
julia> Hyperplane([0.], 1.)
Hyperplane{Float64}([0.0], 1.0)
julia> underapproximate(rand(Interval), BoxDirections(2))
VPolytope{Float64}(Array{Float64,1}[[0.5987999558851578], [-1.1883260639396718], [-1.1883260639396718], [-1.1883260639396718]])
julia> activate_assertions()
julia> Hyperplane([0.], 1.)
ERROR: AssertionError: a hyperplane needs a non-zero normal vector
Stacktrace:
[1] macro expansion at .julia/dev/LazySets/src/Assertions/Assertions.jl:27 [inlined]
[2] Hyperplane{Float64}(::Array{Float64,1}, ::Float64) at .julia/dev/LazySets/src/Sets/Hyperplane.jl:32
[3] Hyperplane(::Array{Float64,1}, ::Float64) at .julia/dev/LazySets/src/Sets/Hyperplane.jl:38
[4] top-level scope at REPL[8]:1
julia> underapproximate(rand(Interval), BoxDirections(2))
ERROR: AssertionError: $(Expr(:escape, :(LazySets.dim(X) == LazySets.dim(dirs))))
Stacktrace:
[1] macro expansion at .julia/dev/LazySets/src/Assertions/Assertions.jl:27 [inlined]
[2] #underapproximate#17(::Bool, ::typeof(underapproximate), ::Interval{Float64,IntervalArithmetic.Interval{Float64}}, ::BoxDirections{Float64}) at .julia/dev/LazySets/src/Approximations/underapproximate.jl:20
[3] underapproximate(::Interval{Float64,IntervalArithmetic.Interval{Float64}}, ::BoxDirections{Float64}) at .julia/dev/LazySets/src/Approximations/underapproximate.jl:20
[4] top-level scope at REPL[9]:1 |
mforets
reviewed
Sep 26, 2019
mforets
approved these changes
Sep 26, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First part of #1699.
I also checked that deactivating the assertions really avoids evaluating the code inside
@assert
completely.This implements the proposal here, which is however more general because now this feature only works for
LazySets
and not for its submodules or other packages likeReachability
. Enumerating all submodules ofLazySets
would not be a problem but I do not know whether we always want to copy-paste this code to all packages. Maybe we should create a helper package?