Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/SpaceExParser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ export readsxmodel, writesxmodel
Load dependencies
=========================================#

using HybridSystems, LazySets
using DataStructures: OrderedDict
import MathematicalSystems
using MathematicalSystems: AbstractSystem, AbstractContinuousSystem,
LinearContinuousSystem, LinearControlContinuousSystem,
using EzXML: readxml, root, eachelement, nodename, nodecontent
using HybridSystems: AbstractSwitching, AutonomousSwitching, GraphAutomaton,
HybridSystem, add_transition!, assignment, guard, inputdim,
inputset, nmodes, ntransitions, resetmap, source, statedim,
stateset, target, transitions
using LazySets: LazySets, AbstractHyperrectangle, HalfSpace, Hyperplane,
Intersection, LazySet, Singleton, dim, high, isuniversal, low
using MathematicalSystems: MathematicalSystems, AbstractSystem,
AbstractContinuousSystem, LinearContinuousSystem,
LinearControlContinuousSystem,
AffineContinuousSystem,
AffineControlContinuousSystem,
ConstrainedLinearContinuousSystem,
ConstrainedLinearControlContinuousSystem,
ConstrainedLinearControlDiscreteSystem,
ConstrainedAffineContinuousSystem,
ConstrainedAffineControlContinuousSystem
using EzXML: readxml, root, eachelement, nodename, nodecontent
using SymEngine: Basic, subs
using SymEngine: Basic, free_symbols, subs

import Base: convert

Expand Down
2 changes: 1 addition & 1 deletion src/parse.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const _parse_s = Base.Meta.parse
const _parse_s = Base.Meta.parse # NOTE: this is an internal function
const _parse_t = Base.parse

"""
Expand Down
6 changes: 3 additions & 3 deletions src/symbolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,16 @@ end
# ref_tuple is used for the error message
function _add_invariants!(X, U, invariants, state_variables, input_variables, ref_tuple)
for invi in invariants
if LazySets._ishyperplanar(invi)
if LazySets._ishyperplanar(invi) # NOTE: this is an internal function
set_type = Hyperplane{NUM}
elseif LazySets._ishalfspace(invi)
elseif LazySets._ishalfspace(invi) # NOTE: this is an internal function
set_type = HalfSpace{NUM}
else
loc_or_trans, id = ref_tuple
error_msg_set(loc_or_trans, invi, id)
end

vars = LazySets.free_symbols(invi, set_type)
vars = free_symbols(invi, set_type)
got_state_invariant = all(si in state_variables for si in vars)
got_input_invariant = all(si in input_variables for si in vars)
if got_state_invariant
Expand Down
6 changes: 0 additions & 6 deletions test/Aqua.jl

This file was deleted.

2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
HybridSystems = "2207ec0c-686c-5054-b4d2-543502888820"
LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043"
Expand All @@ -8,6 +9,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.8.9"
ExplicitImports = "1"
EzXML = "1"
HybridSystems = "0.4"
LazySets = "3, 4, 5"
Expand Down
18 changes: 18 additions & 0 deletions test/quality_assurance.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using SpaceExParser, Test
import Aqua, ExplicitImports

@testset "ExplicitImports tests" begin
@test isnothing(ExplicitImports.check_all_explicit_imports_are_public(SpaceExParser))
@test isnothing(ExplicitImports.check_all_explicit_imports_via_owners(SpaceExParser))
ignores = (:_ishalfspace, :_ishyperplanar, :parse,)
@test isnothing(ExplicitImports.check_all_qualified_accesses_are_public(SpaceExParser;
ignore=ignores))
@test isnothing(ExplicitImports.check_all_qualified_accesses_via_owners(SpaceExParser))
@test isnothing(ExplicitImports.check_no_implicit_imports(SpaceExParser))
@test isnothing(ExplicitImports.check_no_self_qualified_accesses(SpaceExParser))
@test isnothing(ExplicitImports.check_no_stale_explicit_imports(SpaceExParser))
end

@testset "Aqua tests" begin
Aqua.test_all(SpaceExParser)
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ include("unit_parse.jl")
include("unit_affine.jl")
end

include("Aqua.jl")
include("quality_assurance.jl")
Loading