Skip to content

Multiple optimisations for TimeSeries methods

Duncan Macleod requested to merge github/fork/duncanmmacleod/optimization into master

This PR introduces a number of critical optimisations for routines in GWpy. The summary is as follows:

  • gwpy.segments is now only imported at the function level for Channel objects and all Array sub-classes (include, e.g, TimeSeries) - this import is slow because it relies on gwpy.table.ligolw imports
  • `TimeSeries.read(format='framecpp') now intelligently handles accessing the TOC for a frame, and does it as seldom as possible
  • TimeSeries.spectrogram now calculates a single window function up-front, rather than passing the default argument and having scipy recalculate the window function every time welch is called
  • TimeSeries.read(cache) will now try to use lalframe-based serial access for up to 4 channels since lalframe is much faster than frameCPP.py - this is set in gwpy.timeseries.io.cache.MAX_LALFRAME_CHANNELS

Additionally, a number of bugs have been squashed as they were discovered.

Merge request reports