Closed mattngc closed 5 years ago
i've already considered this on multiple occasions. There are a few API issues to solve - notably how to handle the self sampling. Easier to explain this in person. This would be an API breaking change.
Discussed this with @CnlPepper, sounds like this is deceptively complicated. Will leave it for a later refactor. But I suggest as a minumum, SpectralFunction should mirror the Function1D interface where possible. i.e. there should be a cdef evaluate()
method.
At the moment spectral function is a standalone class, but to me it looks like it should inherit from Function1D. Then it should follow the normal pattern of call() and cpdef evaluate() in the reset of the framework. In fact a lot of the attributes and functions on this class appear to be supporting higher level functional operations, such as integration and sampling the function over a range. I would argue a lot of this could be consolidated into the function framework.
Perhaps the big disadvantages of this change would be the amount of work to support all this machinery in 2D and 3D functions.