Skip to content

Commit 1a3f7d4

Browse files
committed
Make array_type an actual type, though only in a limited sense
1 parent 9bf734d commit 1a3f7d4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/systems/callbacks.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,15 +1105,15 @@ function compile_user_affect(affect::ImperativeAffect, cb, sys, dvs, ps; kwargs.
11051105
end
11061106
obs_fun = build_explicit_observed_function(
11071107
sys, Symbolics.scalarize.(obs_exprs);
1108-
array_type = :tuple)
1108+
array_type = Tuple)
11091109
obs_sym_tuple = (obs_syms...,)
11101110

11111111
# okay so now to generate the stuff to assign it back into the system
11121112
mod_pairs = mod_exprs .=> mod_syms
11131113
mod_names = (mod_syms...,)
11141114
mod_og_val_fun = build_explicit_observed_function(
11151115
sys, Symbolics.scalarize.(first.(mod_pairs));
1116-
array_type = :tuple)
1116+
array_type = Tuple)
11171117

11181118
upd_funs = NamedTuple{mod_names}((setu.((sys,), first.(mod_pairs))...,))
11191119

src/systems/diffeqs/odesystem.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ Options not otherwise specified are:
429429
* `op = Operator` sets the recursion terminator for the walk done by `vars` to identify the variables that appear in `ts`. See the documentation for `vars` for more detail.
430430
* `throw = true` if true, throw an error when generating a function for `ts` that reference variables that do not exist
431431
* `drop_expr` is deprecated.
432-
* `array_type`; only used if the output is an array (that is, `!isscalar(ts)`). If `:array`, then it will generate an array, if `:tuple` then it will generate a tuple.
432+
* `array_type`; only used if the output is an array (that is, `!isscalar(ts)`). If it is `Vector`, then it will generate an array, if `Tuple` then it will generate a tuple.
433433
"""
434434
function build_explicit_observed_function(sys, ts;
435435
inputs = nothing,
@@ -444,7 +444,7 @@ function build_explicit_observed_function(sys, ts;
444444
param_only = false,
445445
op = Operator,
446446
throw = true,
447-
array_type = :array)
447+
array_type = Vector)
448448
if (isscalar = symbolic_type(ts) !== NotSymbolic())
449449
ts = [ts]
450450
end
@@ -590,7 +590,7 @@ function build_explicit_observed_function(sys, ts;
590590
end
591591

592592
output_expr = isscalar ? ts[1] :
593-
(array_type == :array ? MakeArray(ts, output_type) : MakeTuple(ts))
593+
(array_type <: Vector ? MakeArray(ts, output_type) : MakeTuple(ts))
594594
# Need to keep old method of building the function since it uses `output_type`,
595595
# which can't be provided to `build_function`
596596
oop_fn = Func(args, [], pre(Let(obsexprs, output_expr, false))) |> array_wrapper[1] |>

0 commit comments

Comments
 (0)