summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-05-11 18:00:33 +0200
committerNao Pross <np@0hm.ch>2024-05-11 18:00:33 +0200
commit1de20b2dafad3b400ebe9d69f4cc8ee54044348a (patch)
treeef9ca1c6ce65ce7679127c7e391441e1946fff29
parentFix ParametrizeExpr, was broken since changes in ExpressionState (diff)
downloadpolymatrix-1de20b2dafad3b400ebe9d69f4cc8ee54044348a.tar.gz
polymatrix-1de20b2dafad3b400ebe9d69f4cc8ee54044348a.zip
Mark get_variable_indices_from_variable as deprecated
Diffstat (limited to '')
-rw-r--r--polymatrix/expression/utils/getvariableindices.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/polymatrix/expression/utils/getvariableindices.py b/polymatrix/expression/utils/getvariableindices.py
index aebdeb0..d87f82e 100644
--- a/polymatrix/expression/utils/getvariableindices.py
+++ b/polymatrix/expression/utils/getvariableindices.py
@@ -3,15 +3,17 @@ import typing
from polymatrix.expressionstate.abc import ExpressionState
from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin
+from polymatrix.utils.deprecation import deprecated
# NP: very confusing name without explaination / context
# NP: why is this not a feature of expressionstate?
-# FIXME: typing, especially return type
+@deprecated("Replaced by helper methods in ExpressionState")
def get_variable_indices_from_variable(
state: ExpressionState,
variable: ExpressionBaseMixin | int | typing.Any,
) -> tuple[int, ...] | None:
+
if isinstance(variable, ExpressionBaseMixin):
state, variable_polynomial = variable.apply(state)
@@ -50,7 +52,7 @@ def get_variable_indices_from_variable(
return state, variable_indices
-# not used, remove?
+@deprecated("Replaced by helper methods in ExpressionState")
def get_variable_indices(state, variables):
if not isinstance(variables, tuple):
variables = (variables,)