Skip to content

Commit 6db6494

Browse files
feat: add hook during problem construction
1 parent 8ae5148 commit 6db6494

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
@@ -1296,6 +1296,8 @@ function get_p_constructor(p_constructor, pType::Type, floatT::Type)
12961296
end
12971297
end
12981298

1299+
abstract type ProblemConstructionHook end
1300+
12991301
"""
13001302
$(TYPEDSIGNATURES)
13011303
@@ -1348,6 +1350,8 @@ function process_SciMLProblem(
13481350

13491351
check_inputmap_keys(sys, op)
13501352

1353+
op = getmetadata(sys, ProblemConstructionHook, identity)(op)
1354+
13511355
defs = add_toterms(recursive_unwrap(defaults(sys)); replace = is_discrete_system(sys))
13521356
kwargs = NamedTuple(kwargs)
13531357

0 commit comments

Comments
 (0)