# Path: pygesture/filestruct.py
# def new_session_dir(rootdir, pid, sid):
# def get_recording_dir(session_dir):
# def get_processed_dir(session_dir):
# def get_log_dir(session_dir):
# def get_recording_file(recording_dir, pid, sid, date_str, trial_num,
#                        label=None):
# def get_log_file(log_dir, pid, sid, date_str, trial_num):
# def find_session_dir(rootdir, pid, sid):
# def new_feature_file(session_dir, pid, sid, date_string):
# def find_feature_file(rootdir, pid, sid):
# def get_participant_list(rootdir):
# def get_session_list(rootdir, pid, search=""):
# def get_feature_file_list(rootdir, pid, sid_list):
# def get_recording_file_list(recording_dir):
# def get_log_file_list(log_dir):
# def parse_date_string(name):
# def parse_trial_number(name):
# def parse_label(name):
# 
# Path: pygesture/wav.py
# def write(filename, rate, data):
# def read(filename):
#     def __init__(self, filename, fs):
#     def write(self, data):
#     def close(self):
# class ContinuousWriter(object):


import os
import numpy as np
from multiprocessing import Pool
from pygesture import filestruct
from pygesture import wav
        Path to the feature file to be generated.
    """
    def __init__(self, rootdir, pid, sid, processor):
        self.sid = sid
        self.pid = pid
        self.processor = processor

        self.sessdir = filestruct.find_session_dir(rootdir, pid, sid)
        self.rawdir = filestruct.get_recording_dir(self.sessdir)
        self.procdir = filestruct.get_processed_dir(self.sessdir)

        self.featfile = filestruct.new_feature_file(
            self.sessdir,
            self.pid,
            self.sid,
            filestruct.parse_date_string(self.sessdir))

        if not os.path.exists(self.procdir):
            os.mkdir(self.procdir)

    def process(self, saveproc=True):
        """
        Iterates over all recordings in the session, processes them (see
        Recording's process method), writes the conditioned data to procdir,
        and writes the features to a CSV file.
        """
        if os.path.isfile(self.featfile):
            os.remove(self.featfile)

        with open(self.featfile, 'ab') as fid:

# Path: pygesture/filestruct.py
# def new_session_dir(rootdir, pid, sid):
# def get_recording_dir(session_dir):
# def get_processed_dir(session_dir):
# def get_log_dir(session_dir):
# def get_recording_file(recording_dir, pid, sid, date_str, trial_num,
#                        label=None):
# def get_log_file(log_dir, pid, sid, date_str, trial_num):
# def find_session_dir(rootdir, pid, sid):
# def new_feature_file(session_dir, pid, sid, date_string):
# def find_feature_file(rootdir, pid, sid):
# def get_participant_list(rootdir):
# def get_session_list(rootdir, pid, search=""):
# def get_feature_file_list(rootdir, pid, sid_list):
# def get_recording_file_list(recording_dir):
# def get_log_file_list(log_dir):
# def parse_date_string(name):
# def parse_trial_number(name):
# def parse_label(name):
# 
# Path: pygesture/wav.py
# def write(filename, rate, data):
# def read(filename):
#     def __init__(self, filename, fs):
#     def write(self, data):
#     def close(self):
# class ContinuousWriter(object):


# Path: pygesture/analysis/processing.py
import os
import numpy as np
from multiprocessing import Pool
from pygesture import filestruct
from pygesture import wav

        Path to the feature file to be generated.
    """
    def __init__(self, rootdir, pid, sid, processor):
        self.sid = sid
        self.pid = pid
        self.processor = processor

        self.sessdir = filestruct.find_session_dir(rootdir, pid, sid)
        self.rawdir = filestruct.get_recording_dir(self.sessdir)
        self.procdir = filestruct.get_processed_dir(self.sessdir)

        self.featfile = filestruct.new_feature_file(
            self.sessdir,
            self.pid,
            self.sid,
            filestruct.parse_date_string(self.sessdir))

        if not os.path.exists(self.procdir):
            os.mkdir(self.procdir)

    def process(self, saveproc=True):
        """
        Iterates over all recordings in the session, processes them (see
        Recording's process method), writes the conditioned data to procdir,
        and writes the features to a CSV file.
        """
        if os.path.isfile(self.featfile):
            os.remove(self.featfile)

        with open(self.featfile, 'ab') as fid:

            for f in filestruct.get_recording_file_list(self.rawdir):