TensorIndexType.epsilon always returns None

19 views
Skip to first unread message

r.du...@gmail.com

unread,
Jul 26, 2017, 12:49:07 PM7/26/17
to sy...@googlegroups.com
Dear developers of module tensor

I have the impression that the method TensorIndexType.epsilon always returns None (see EXAMPLE below)

I guess that this misbehavior is due to the initial check in method get_epsilon, which reads

def get_epsilon(self):
if not isinstance(self._eps_dim, int):
return None
...
see https://github.com/sympy/sympy/blob/master/sympy/tensor/tensor.py#L1725

My example suggests that int should be replaced by Integer...

ric

EXAMPLE obtained from Sympy live
>>> from sympy.tensor.tensor import *
>>> E3 = TensorIndexType('E3', dim=3, dummy_fmt='l')
>>> E3.epsilon == None
True

>>> E3.get_epsilon() == None
True

>>> isinstance(E3._eps_dim, int)
False

>>> isinstance(E3._eps_dim, Integer)
True

Francesco Bonazzi

unread,
Jul 27, 2017, 12:04:34 PM7/27/17
to sympy
Reply all
Reply to author
Forward
0 new messages