diff options
author | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2023-05-09 09:46:20 +0200 |
---|---|---|
committer | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2023-05-09 09:46:20 +0200 |
commit | c7a6424aff9a904b3452b42cba8c5422c147292c (patch) | |
tree | be0bbed545c6faa2fea641eaa76f1b33512123da /polymatrix/expression/utils/getvariableindices.py | |
parent | reshape according to the number of rows of expressions (diff) | |
download | polymatrix-c7a6424aff9a904b3452b42cba8c5422c147292c.tar.gz polymatrix-c7a6424aff9a904b3452b42cba8c5422c147292c.zip |
save offset of a parameter with its name
Diffstat (limited to 'polymatrix/expression/utils/getvariableindices.py')
-rw-r--r-- | polymatrix/expression/utils/getvariableindices.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/polymatrix/expression/utils/getvariableindices.py b/polymatrix/expression/utils/getvariableindices.py index 61bae2a..4ee7037 100644 --- a/polymatrix/expression/utils/getvariableindices.py +++ b/polymatrix/expression/utils/getvariableindices.py @@ -29,16 +29,13 @@ def get_variable_indices_from_variable(state, variable) -> tuple[int] | None: variable_indices = tuple(gen_variables_indices()) elif isinstance(variable, int): - # raise Exception(f'{variable=}') variable_indices = (variable,) elif variable in state.offset_dict: - # raise Exception(f'{variable=}') - variable_indices = (state.offset_dict[variable][0],) + variable_indices = tuple(range(*state.offset_dict[variable])) else: variable_indices = None - # raise Exception(f'variable index not found for {variable=}, {state.offset_dict=}') return state, variable_indices |