python-neo icon indicating copy to clipboard operation
python-neo copied to clipboard

Deprecation in pq.Quantity of the copy argument

Open mscheltienne opened this issue 1 year ago • 3 comments

Spotted today on CIs in MNE-Python: https://github.com/mne-tools/mne-python/actions/runs/10577451925/job/29305474492?pr=12815#step:17:5232

 neo/io/proxyobjects.py:296: in load
    anasig = AnalogSignal(
neo/core/analogsignal.py:202: in __new__
    obj = pq.Quantity(signal, units=units, dtype=dtype, copy=copy).view(cls)
quantities/quantity.py:120: in __new__
    warnings.warn(("The 'copy' argument in Quantity is deprecated and will be removed in the future. "
E   quantities.QuantitiesDeprecationWarning: The 'copy' argument in Quantity is deprecated and will be removed in the future. The argument has no effect since quantities-0.16.0 (to aid numpy-2.0 support).

mscheltienne avatar Aug 27 '24 12:08 mscheltienne

@zm711 can you handle this?

apdavison avatar Aug 27 '24 13:08 apdavison

Sure looks like a pretty quick fix. I'll assign myself. I'm busy today, but will work on this week!

zm711 avatar Aug 27 '24 13:08 zm711

@apdavison,

We have a huge portion of our object model that relies on copy vs view of the data. The new default is now always a view, so we have some test failures here because we are testing for copy vs view. Do we want to try to maintain this behavior at the Neo level instead of the quantities level. I think we could just add some deepcopies into the Neo code instead of passing copy to Quantities. I think I will actually move discussion to my issue #1534 for us to strategize.

zm711 avatar Aug 27 '24 16:08 zm711