limiting size of obspy.core.trace.Trace.stats.processing

Hi All

Q: Is it possible to limit the size of the list used by obspy.core.trace.Trace.stats.processing

Background:
I’m working on a utility that will listen to seedlink streams temporarily storing the data in a ringbuffer. The ringbuffer is currently implemented using merge() and trim() methods of the obspy.core.stream.Stream class.

However each use of trim() adds an entry to obspy.core.trace.Trace.stats.processing so with time this list stands to grow large unless limited in size. Currently my workaround is to pop that last element of the list after each usage of the trim() method, but perhaps there’s a better way to handle this.

regP

Hi Peter,

this is really an edge use case thus we are unlikely to implement something along these lines in ObsPy core. One really has to process for a very very long time until that list grows large enough to be an annoyance on modern computers.

Just clearing the list once in a while is probably the simplest solution. You could always monkey patch the method that adds the processing information or replace the list with a some queue data structure but both are probably not worth the effort.

Cheers!

Lion

Ok,

I guess my workaround will do then, and the post here can serve as a source of information if anyone else stumbles across this

regP