Re: [SciPy-Dev] "invalid" matrices in signaltools.py
Hello all, I have a PR up here <https://github.com/scipy/scipy/pull/5904> that allows functions like "convolve" and "correlate" to accept matrices in either order for the "valid" order. People seem to be in general agreement that either order should be accepted. The question is how to handle inputs where one matrix is not strictly larger than the other (i.e. the dimensions of one matrix are not all at least as large as the analogous dimension of another). My proposal is to let such arguments pass through, as the function will always return the empty matrix as expected. However, others are more in favor of throwing an Exception. What are people's thoughts? Thanks! Greg
On Do, 2016-03-03 at 10:01 +0000, G Young wrote:
Hello all,
I have a PR up here that allows functions like "convolve" and "correlate" to accept matrices in either order for the "valid" order. People seem to be in general agreement that either order should be accepted. The question is how to handle inputs where one matrix is not strictly larger than the other (i.e. the dimensions of one matrix are not all at least as large as the analogous dimension of another).
My proposal is to let such arguments pass through, as the function will always return the empty matrix as expected. However, others are more in favor of throwing an Exception. What are people's thoughts?
Not really my thing, but my gut feeling would be an exception as well; unless someone can think of an example where it might be useful (i.e. for empty arrays you can often construct examples by thinking of data stream chunks or groups which happen to have 0 items in them). The empty array in general does seem to loose information though. After all, you do not have an empty array of shape (3, -2), but of shape (3, 0), and even then since "valid" mode switches which array is the larger one, should it be (3, 0) or maybe (0, 2)? - Sebastian
Thanks!
Greg _______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org https://mail.scipy.org/mailman/listinfo/scipy-dev
participants (2)
-
G Young -
Sebastian Berg