fix: create signal and waveform views with reshape - #1886
Conversation
c8cfcab to
45e1bc4
Compare
zm711
left a comment
There was a problem hiding this comment.
This seems okay to me Andrew. Our previous strategy forces a reshape as a view rather than as a copy (the old behavior would error if a copy would be required for a particular reshape), but if NumPy is dropping support for using that trick I think it is fine to do just do the reshape and if a copy of the array is required then do it and take a computational hit. If you have a different idea feel free to suggest that.
|
LGTM too, just a minor comment for @stanbot8 |
| logging.getLogger().setLevel(logging.INFO) | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("error:Setting the shape on a NumPy array has been deprecated:DeprecationWarning") |
There was a problem hiding this comment.
these should not warn anymore, right?
| @pytest.mark.filterwarnings("error:Setting the shape on a NumPy array has been deprecated:DeprecationWarning") |
| self.assertEqual(signal.t_stop, len(data) / rate) | ||
| self.assertEqual(signal[9, 0], 9000 * pq.uV) | ||
|
|
||
| @pytest.mark.filterwarnings("error:Setting the shape on a NumPy array has been deprecated:DeprecationWarning") |
There was a problem hiding this comment.
these should not warn anymore, right?
| @pytest.mark.filterwarnings("error:Setting the shape on a NumPy array has been deprecated:DeprecationWarning") |
|
@alejoe91 Right, they don't warn anymore. The |
yes please! |
45e1bc4 to
90bda1f
Compare
|
Done, dropped both. |
|
Thanks @stanbot8. We typically add people to our author list with an affiliation. If you'd like to be included in the next release could you provide the name and affiliation you'd like to include (if you have an academic/work affiliation that you feel should be included). Thanks! |
|
Thanks! I'd be happy to be included. Please list me as Stanley C., Independent Contributor. |
Signal and waveform creation changes NumPy array dimensions through attribute assignment. Create 2D signal and 3D waveform views with reshape. This keeps both data paths on the supported NumPy array API and avoids the NumPy 2.5 deprecation. All tests pass.