Skip to content

Commit 1c1d530

Browse files
refactor: format
1 parent 643beba commit 1c1d530

File tree

1 file changed

+110
-21
lines changed

1 file changed

+110
-21
lines changed

src/systems/diffeqs/odesystem.jl

Lines changed: 110 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,46 @@ struct ODESystem <: AbstractODESystem
173173
"""
174174
parent::Any
175175

176-
function ODESystem(tag, deqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, tgrad,
177-
jac, ctrl_jac, Wfact, Wfact_t, name, systems, defaults, guesses,
178-
torn_matching, initializesystem, initialization_eqs, schedule,
179-
connector_type, preface, cevents,
180-
devents, parameter_dependencies,
181-
metadata = nothing, gui_metadata = nothing,
176+
function ODESystem(
177+
tag,
178+
deqs,
179+
iv,
180+
dvs,
181+
ps,
182+
tspan,
183+
var_to_name,
184+
ctrls,
185+
observed,
186+
tgrad,
187+
jac,
188+
ctrl_jac,
189+
Wfact,
190+
Wfact_t,
191+
name,
192+
systems,
193+
defaults,
194+
guesses,
195+
torn_matching,
196+
initializesystem,
197+
initialization_eqs,
198+
schedule,
199+
connector_type,
200+
preface,
201+
cevents,
202+
devents,
203+
parameter_dependencies,
204+
metadata = nothing,
205+
gui_metadata = nothing,
182206
tearing_state = nothing,
183-
substitutions = nothing, complete = false, index_cache = nothing,
184-
discrete_subsystems = nothing, solved_unknowns = nothing,
185-
split_idxs = nothing, parent = nothing; checks::Union{Bool, Int} = true)
207+
substitutions = nothing,
208+
complete = false,
209+
index_cache = nothing,
210+
discrete_subsystems = nothing,
211+
solved_unknowns = nothing,
212+
split_idxs = nothing,
213+
parent = nothing;
214+
checks::Union{Bool, Int} = true
215+
)
186216
if checks == true || (checks & CheckComponents) > 0
187217
check_variables(dvs, iv)
188218
check_parameters(ps, iv)
@@ -193,12 +223,45 @@ struct ODESystem <: AbstractODESystem
193223
u = __get_unit_type(dvs, ps, iv)
194224
check_units(u, deqs)
195225
end
196-
new(tag, deqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, tgrad, jac,
197-
ctrl_jac, Wfact, Wfact_t, name, systems, defaults, guesses, torn_matching,
198-
initializesystem, initialization_eqs, schedule, connector_type, preface,
199-
cevents, devents, parameter_dependencies, metadata,
200-
gui_metadata, tearing_state, substitutions, complete, index_cache,
201-
discrete_subsystems, solved_unknowns, split_idxs, parent)
226+
new(
227+
tag,
228+
deqs,
229+
iv,
230+
dvs,
231+
ps,
232+
tspan,
233+
var_to_name,
234+
ctrls,
235+
observed,
236+
tgrad,
237+
jac,
238+
ctrl_jac,
239+
Wfact,
240+
Wfact_t,
241+
name,
242+
systems,
243+
defaults,
244+
guesses,
245+
torn_matching,
246+
initializesystem,
247+
initialization_eqs,
248+
schedule,
249+
connector_type,
250+
preface,
251+
cevents,
252+
devents,
253+
parameter_dependencies,
254+
metadata,
255+
gui_metadata,
256+
tearing_state,
257+
substitutions,
258+
complete,
259+
index_cache,
260+
discrete_subsystems,
261+
solved_unknowns,
262+
split_idxs,
263+
parent
264+
)
202265
end
203266
end
204267

@@ -263,12 +326,38 @@ function ODESystem(deqs::AbstractVector{<:Equation}, iv, dvs, ps;
263326
disc_callbacks = SymbolicDiscreteCallbacks(discrete_events)
264327
parameter_dependencies, ps′ = process_parameter_dependencies(
265328
parameter_dependencies, ps′)
266-
ODESystem(Threads.atomic_add!(SYSTEM_COUNT, UInt(1)),
267-
deqs, iv′, dvs′, ps′, tspan, var_to_name, ctrl′, observed, tgrad, jac,
268-
ctrl_jac, Wfact, Wfact_t, name, systems, defaults, guesses, nothing, initializesystem,
269-
initialization_eqs, schedule, connector_type, preface, cont_callbacks,
270-
disc_callbacks, parameter_dependencies,
271-
metadata, gui_metadata, checks = checks)
329+
ODESystem(
330+
Threads.atomic_add!(SYSTEM_COUNT, UInt(1)),
331+
deqs,
332+
iv′,
333+
dvs′,
334+
ps′,
335+
tspan,
336+
var_to_name,
337+
ctrl′,
338+
observed,
339+
tgrad,
340+
jac,
341+
ctrl_jac,
342+
Wfact,
343+
Wfact_t,
344+
name,
345+
systems,
346+
defaults,
347+
guesses,
348+
nothing,
349+
initializesystem,
350+
initialization_eqs,
351+
schedule,
352+
connector_type,
353+
preface,
354+
cont_callbacks,
355+
disc_callbacks,
356+
parameter_dependencies,
357+
metadata,
358+
gui_metadata,
359+
checks = checks
360+
)
272361
end
273362

274363
function ODESystem(eqs, iv; kwargs...)

0 commit comments

Comments
 (0)