Tools for Developing Syncopy#
The following is a collection of routines, decorators and classes that constitute the basic building blocks of Syncopy. Syncopy’s entire source-code is built using following a modular structure where basic building blocks are written (and tested) once and then re-used throughout the entire package.
Input Parsing and Error Checking#
|
Parse array-like objects |
|
Parse syncopy data objects |
|
Extract information from Syncopy file and folder names |
|
Parse file-system location strings for reading/writing files/directories |
|
Parse scalars |
Decorators#
Decorator that unwraps cfg "structure" in metafunction call |
|
Decorator for handling in-place data selections via select keyword |
|
Decorator for handling parallel execution of a |
|
|
Decorator for handling parallelization via parallel keyword/client detection |
Writing A New Analysis Routine#
Any analysis routine that operates on Syncopy data is always structured in three (hierarchical) parts:
A numerical function based only on NumPy/SciPy that works on a
numpy.ndarray
and returns anumpy.ndarray
.A wrapper class that handles output initialization, potential parallelization and post-computation cleanup. The class should be based on the abstract class
syncopy.shared.computational_routine.ComputationalRoutine
Another wrapping metafunction handling method selection, parameterization and error checking is then provided for user interaction.
An example of this type of structure is the multi-taper fourier analysis. The corresponding stages here are
Numerical function:
syncopy.specest.mtmfft.mtmfft()
Wrapper class:
syncopy.specest.mtmfft.MultiTaperFFT
Metafunction:
syncopy.freqanalysis()

For a detailed walk-through explaining the intricacies of writing an analysis routine, please refer to the Design Guide: Syncopy Compute Classes.