Skip to content

Commit ea917fc

Browse files
feat: add hook during problem construction
1 parent fbef1a8 commit ea917fc

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
@@ -1272,6 +1272,8 @@ function get_p_constructor(p_constructor, pType::Type, floatT::Type)
12721272
end
12731273
end
12741274

1275+
abstract type ProblemConstructionHook end
1276+
12751277
"""
12761278
$(TYPEDSIGNATURES)
12771279
@@ -1324,6 +1326,8 @@ function process_SciMLProblem(
13241326

13251327
check_inputmap_keys(sys, op)
13261328

1329+
op = getmetadata(sys, ProblemConstructionHook, identity)(op)
1330+
13271331
defs = add_toterms(recursive_unwrap(defaults(sys)); replace = is_discrete_system(sys))
13281332
kwargs = NamedTuple(kwargs)
13291333

0 commit comments

Comments
 (0)