Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getu seems broken for ArraySymbolic #95

Open
hexaeder opened this issue Aug 12, 2024 · 0 comments
Open

getu seems broken for ArraySymbolic #95

hexaeder opened this issue Aug 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hexaeder
Copy link

If getu(sys, sym::ArraySymbolic) with an ArraySymbolic, sym used to be collected. Now, it resolves the indices, idx = variable_indices(sys, sym) which, in my case, returns something like Int[1,2]. However this ends up as some _getp call

ts_idxs = get_all_timeseries_indexes(sys, sym_arr)
if !(ContinuousTimeseries() in ts_idxs)
return getp(sys, sym)
end

because sym_arr = [1,2] which is neither variable nor parameter of my inpr thus the timeseries idx do not contain ContinuousTimeseries().

Can be solved if get_all_timeseries_indexes(inpr, sym) returns Set([SII.ContinuousTimeseries()]) for random inputs (in this case: integers). But does this really make sense? For example, that's not how it is defined in SymbolCache, which just returns an empty set.

function get_all_timeseries_indexes(sc::SymbolCache, sym)
if is_variable(sc, sym) || is_independent_variable(sc, sym)
return Set([ContinuousTimeseries()])
elseif is_timeseries_parameter(sc, sym)
return Set([timeseries_parameter_index(sc, sym).timeseries_idx])
else
return Set()
end
end

@hexaeder hexaeder added the bug Something isn't working label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant