summaryrefslogtreecommitdiffstats
path: root/polymatrix/expression/utils/getvariableindices.py
diff options
context:
space:
mode:
authorMichael Schneeberger <michael.schneeberger@fhnw.ch>2023-05-09 09:46:20 +0200
committerMichael Schneeberger <michael.schneeberger@fhnw.ch>2023-05-09 09:46:20 +0200
commitc7a6424aff9a904b3452b42cba8c5422c147292c (patch)
treebe0bbed545c6faa2fea641eaa76f1b33512123da /polymatrix/expression/utils/getvariableindices.py
parentreshape according to the number of rows of expressions (diff)
downloadpolymatrix-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.py5
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