DrMarc / slab

python classes for working with sounds and conducting psychoacoustic experiments
MIT License
22 stars 7 forks source link

Added a sensible equality check to `Signal`. #67

Closed sammosummo closed 1 year ago

sammosummo commented 1 year ago

I believe that Signal (and any of its subclasses) is fully specified by its data and samplerate. Accordingly, I overwrote the __eq__ method to check these attributes only. This should be efficient as its comparing two attributes only, not everything in the object, and it allows me to serialise/deserialise signals.

DrMarc commented 1 year ago

Hi, This seems to break hashability of Signal and Sound objects. Not sure why.