Skip to content

Commit

Permalink
fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
hexaeder committed Nov 28, 2024
1 parent d8bb381 commit 1497e01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/component_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ function _fill_defaults(T, @nospecialize(kwargs))
#### External Inputs
####
if haskey(dict, :extin)
@assert dict[:extin] isa Vector{<:SymbolicIndex}
@assert dict[:extin] isa Union{Nothing, Vector{<:SymbolicIndex}}
else
dict[:extin] = nothing
end
Expand Down
2 changes: 2 additions & 0 deletions src/external_inputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ function ExtMap(im::IndexManager)
isempty(map) && error("There are no external inputs.")

for (vi, vm) in pairs(im.vertexm)
has_external_input(vm) || continue
for (i, si) in pairs(vm.extin)
map[im.v_ext[vi][i]] = _symidx_to_extidx(im, si)
end
end
for (ei, em) in pairs(im.edgem)
has_external_input(em) || continue
for (i, si) in pairs(em.extin)
map[im.e_ext[ei][i]] = _symidx_to_extidx(im, si)
end
Expand Down
2 changes: 1 addition & 1 deletion src/symbolicindexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ function _get_observed_f(nw::Network, cf::EdgeModel, eidx)
@closure (u, outbuf, aggbuf, extbuf, p, t) -> begin
ins = (view(outbuf, esrcr), view(outbuf, edstr))
if has_external_input(cf)
(ins..., view(aggbuf, aggr), view(extbuf, extr))
(ins..., view(extbuf, extr))
end
cf.obsf(ret, view(u, ur), ins..., view(p, pr), t)
ret
Expand Down

0 comments on commit 1497e01

Please sign in to comment.