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
It would be useful to allow symbolic arguments to ndindex functions. The best way to do it is to allow the inputs to be SymPy expressions. This would require rewriting all the functions so that they can return SymPy expressions. In particular, functions would either have to be nested somehow, or else return sympy.Piecewise objects. Some functions use more advanced things like the Chinese Remainder Theorem, so it isn't clear to me how to represent those completely symbolically.
Aside from allowing people to do calculations on expressions, one advantage of doing this is that it would provide a way for people to generate functions for indexed operations that do not depend on ndindex. The idea would be symbolic input -> ndindex -> sympy expression -> codegen to Python.
An open question is how to handle None as an input to Slice. Clearly an expression like x + 1 cannot be None, but should we allow a single Symbol x to be None? And if so, how do we represent that symbolically?
This is a very long term goal. I want to get things working with numeric arguments first.
The text was updated successfully, but these errors were encountered:
It would be useful to allow symbolic arguments to ndindex functions. The best way to do it is to allow the inputs to be SymPy expressions. This would require rewriting all the functions so that they can return SymPy expressions. In particular, functions would either have to be nested somehow, or else return
sympy.Piecewise
objects. Some functions use more advanced things like the Chinese Remainder Theorem, so it isn't clear to me how to represent those completely symbolically.Aside from allowing people to do calculations on expressions, one advantage of doing this is that it would provide a way for people to generate functions for indexed operations that do not depend on ndindex. The idea would be symbolic input -> ndindex -> sympy expression -> codegen to Python.
An open question is how to handle None as an input to Slice. Clearly an expression like
x + 1
cannot be None, but should we allow a single Symbolx
to be None? And if so, how do we represent that symbolically?This is a very long term goal. I want to get things working with numeric arguments first.
The text was updated successfully, but these errors were encountered: