You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would require adding another option to output formatting (e.g. sympy_expr_labels). When requested sympy expressions would be labeled with the python name for the expressions just as equations are by default.
The operation to extract equation labels could be used more generically and not be a part of the expression object. Rough code to get the necessary string for the label would be:
def _get_eqn_name(expr):
"""
Tries to find the python string name that refers to a sympy object. In
IPython environments (IPython, Jupyter, etc...) looks in the user_ns.
If not in an IPython environment looks in __main__.
:return: string value if found or empty string.
"""
import __main__ as shell
for k in dir(shell):
item = getattr(shell, k)
if isinstance(item, Basic):
if item == expr and not k.startswith('_'):
return k
return ''
This could also take over for the similar function currently embedded in the equation type, further removing output tweaking from sympy proper.
The text was updated successfully, but these errors were encountered:
This would require adding another option to output formatting (e.g.
sympy_expr_labels
). When requested sympy expressions would be labeled with the python name for the expressions just as equations are by default.The operation to extract equation labels could be used more generically and not be a part of the expression object. Rough code to get the necessary string for the label would be:
This could also take over for the similar function currently embedded in the equation type, further removing output tweaking from sympy proper.
The text was updated successfully, but these errors were encountered: