Skip to content

Commit

Permalink
Handle dummy derivatives in linearization_function
Browse files Browse the repository at this point in the history
The issue here is that the homogenous parameter PR that was merged broke `linearization_function`, which led to a further PR that broke the user interface to `linearization_function` such that the user now needs to provide an "example input" that encodes the types that the generated function would eventually be called with.

I find this a very bad design and a quite unfortunate breaking change. The fundamental problem is that state and parameter types are important, but the modeling language does not allow the user to encode this information in the model, instead we now ask the users to provide the type information in the form of an example input.
  • Loading branch information
baggepinnen authored Nov 23, 2023
1 parent ddcace4 commit f87fddb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ function linearization_function(sys::AbstractSystem, inputs,
op = merge(defs, op)
end
sys = ssys
x0 = merge(defaults(sys), op)
x0 = merge(defaults(sys), Dict(missing_variable_defaults(sys)), op)

Check warning on line 1306 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L1306

Added line #L1306 was not covered by tests
u0, p, _ = get_u0_p(sys, x0, p; use_union = false, tofloat = true)
p, split_idxs = split_parameters_by_type(p)
ps = parameters(sys)
Expand Down

0 comments on commit f87fddb

Please sign in to comment.