Skip to content

Commit 34a66c7

Browse files
Use name from Variable.name in pymc3.util.get_var_name
1 parent c07c709 commit 34a66c7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pymc3/util.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import numpy as np
2323
import xarray
2424

25-
from aesara.tensor.var import TensorVariable
26-
2725
from pymc3.exceptions import SamplingError
2826

2927
LATEX_ESCAPE_RE = re.compile(r"(%|_|\$|#|&)", re.MULTILINE)
@@ -169,10 +167,7 @@ def get_repr_for_variable(variable, formatting="plain"):
169167

170168
def get_var_name(var):
171169
"""Get an appropriate, plain variable name for a variable."""
172-
if isinstance(var, TensorVariable):
173-
return super(TensorVariable, var).__str__()
174-
else:
175-
return str(var)
170+
return getattr(var, "name", str(var))
176171

177172

178173
def update_start_vals(a, b, model):

0 commit comments

Comments
 (0)