Skip to content

Commit 1534bd6

Browse files
feat: add hook during problem construction
1 parent 09c084b commit 1534bd6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/systems/problem_utils.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,8 @@ function get_p_constructor(p_constructor, pType::Type, floatT::Type)
12571257
end
12581258
end
12591259

1260+
abstract type ProblemConstructionHook end
1261+
12601262
"""
12611263
$(TYPEDSIGNATURES)
12621264
@@ -1309,6 +1311,8 @@ function process_SciMLProblem(
13091311

13101312
check_inputmap_keys(sys, op)
13111313

1314+
op = getmetadata(sys, ProblemConstructionHook, identity)(op)
1315+
13121316
defs = add_toterms(recursive_unwrap(defaults(sys)); replace = is_discrete_system(sys))
13131317
kwargs = NamedTuple(kwargs)
13141318

0 commit comments

Comments
 (0)