Skip to content

Commit

Permalink
fix precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
1-Bart-1 committed Aug 31, 2024
1 parent 91a5b5d commit b7d1ce5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/KPS4_3L.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const SPRINGS_INPUT_3L = [1. 4. -1. # s1: E, A

const KITE_SPRINGS_3L = 6
const KITE_PARTICLES_3L = 4
const KITE_ANGLE_3L = 0.0

"""
mutable struct KPS4_3L{S, T, P, Q, SP} <: AbstractKiteModel
Expand Down Expand Up @@ -177,8 +176,6 @@ $(TYPEDFIELDS)
get_L_D::Union{SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction, Nothing} = nothing
get_D_C::Union{SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction, Nothing} = nothing
get_D_D::Union{SymbolicIndexingInterface.MultipleGetters, SymbolicIndexingInterface.TimeDependentObservedFunction, Nothing} = nothing

# half_drag_force::SVector{P, T} = zeros(SVector{P, T})
end

"""
Expand Down Expand Up @@ -229,9 +226,9 @@ end
function KPS4_3L(kcu::KCU)
set = kcu.set
if set.winch_model == "TorqueControlledMachine"
s = KPS4_3L{SimFloat, KVec3, set.segments*3+2+KITE_PARTICLES, set.segments*3+KITE_SPRINGS_3L, SP}(set=kcu.set, motors=[TorqueControlledMachine(set) for _ in 1:3])
s = KPS4_3L{SimFloat, KVec3, set.segments*3+2+KITE_PARTICLES_3L, set.segments*3+KITE_SPRINGS_3L, SP}(set=kcu.set, motors=[TorqueControlledMachine(set) for _ in 1:3])

Check warning on line 229 in src/KPS4_3L.jl

View check run for this annotation

Codecov / codecov/patch

src/KPS4_3L.jl#L229

Added line #L229 was not covered by tests
else
s = KPS4_3L{SimFloat, KVec3, set.segments*3+2+KITE_PARTICLES, set.segments*3+KITE_SPRINGS_3L, SP}(set=kcu.set, motors=[AsyncMachine(set) for _ in 1:3])
s = KPS4_3L{SimFloat, KVec3, set.segments*3+2+KITE_PARTICLES_3L, set.segments*3+KITE_SPRINGS_3L, SP}(set=kcu.set, motors=[AsyncMachine(set) for _ in 1:3])
end
s.num_E = s.set.segments*3+3
s.num_C = s.set.segments*3+3+1
Expand Down
6 changes: 1 addition & 5 deletions test/test_for_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ let

println("Running models")
if ! @isdefined mtk_kite; mtk_kite = KPS4_3L(KCU(set)); end
if ! @isdefined mtk_integrator
mtk_integrator = KiteModels.init_sim!(mtk_kite; stiffness_factor=0.1, prn=false, mtk=true, torque_control=true)
else
mtk_integrator = KiteModels.reset_sim!(mtk_kite; stiffness_factor=1.0)
end
mtk_integrator = KiteModels.init_sim!(mtk_kite; prn=false, torque_control=true)

println("compiling")
total_new_time = 0.0
Expand Down

0 comments on commit b7d1ce5

Please sign in to comment.