# Path: pupillib/core/workers/processors/dataset_processor.py
# class DatasetDefaults():
#     @staticmethod
#     def pre_defaults():
#         return [{'name': 'custom_resample_stream', 'config': [{'srate': 256}]}]
# 
#     @staticmethod
#     def post_defaults():
#         return []
# 
# Path: pupillib/core/workers/processors/eye_processor.py
# class EyeDefaults():
#     @staticmethod
#     def pre_defaults():
#         return [
#             {
#                 'name': 'None',
#                 'config': {}
#             }
#         ]
# 
#     @staticmethod
#     def post_defaults():
#         return []
# 
# Path: pupillib/core/workers/processors/trial_processor.py
# class TrialDefaults():
#     @staticmethod
#     def pre_defaults():
#         return [
#             {
#                 'name': 'None',
#                 'config': {}
#             }
#         ]
# 
#     @staticmethod
#     def post_defaults():
#         return [
#             #{
#             #    'name': 'rm_zero_value_trials',
#             #    'config': [{'zeros_to_count': 4}, {'digit_tolerance': 0}]
#             #},
#             #{
#             #    'name': 'filter_moving_average',
#             #    'config': [{'window_size': 5}]
#             #},
#             {
#                 'name': 'filter_fft',
#                 'config': [{'highest_freq': 2}, {'lowest_freq': 0}]
#             }
#         ]
# 
# Path: pupillib/core/workers/processors/trigger_processor.py
# class TriggerDefaults():
#     @staticmethod
#     def pre_defaults():
#         return []
# 
#     @staticmethod
#     def post_defaults():
#         return [{'name': 'custom_resample', 'config': [{'srate': 256}]},
#                 {'name': 'rm_baseline', 'config': []},
#                 {'name': 'get_percent_change', 'config': []}]


import argparse
import copy
import math
import sys
import warnings
import os
import ruamel.yaml as yaml
from pupillib.core.workers.processors.dataset_processor import DatasetDefaults
from pupillib.core.workers.processors.eye_processor import EyeDefaults
from pupillib.core.workers.processors.trial_processor import TrialDefaults
from pupillib.core.workers.processors.trigger_processor import TriggerDefaults

                        all_info[eye_config_name] = copy.deepcopy(eye_info)
                if len(data_name_per_dataset[dataset_config_name]) == 0:
                    data_name_per_dataset[dataset_config_name] = ['eye0', 'eye1']

                all_info[dataset_config_name] = copy.deepcopy(dataset_info)
        # If no datasets were found.
        if not all_info:
            raise Exception("Error: No datasets given.")

        self.config['datasets'] = dataset_names
        self.config['data_name_per_dataset'] = data_name_per_dataset
        self.config['parsed_yaml'] = all_info

        if yaml_path:
            self.config = self.parse_processing_defaults(self.config)

    def parse_processing_defaults(self, data_dict):
        def choose_defaults(level, position):
            return {
                'dataset': {
                    'pre_processing': DatasetDefaults.pre_defaults(),
                    'post_processing': DatasetDefaults.post_defaults(),
                },
                'eye': {
                    'pre_processing': EyeDefaults.pre_defaults(),
                    'post_processing': EyeDefaults.post_defaults(),
                },
                'trigger': {
                    'pre_processing': TriggerDefaults.pre_defaults(),

# Path: pupillib/core/workers/processors/dataset_processor.py
# class DatasetDefaults():
#     @staticmethod
#     def pre_defaults():
#         return [{'name': 'custom_resample_stream', 'config': [{'srate': 256}]}]
# 
#     @staticmethod
#     def post_defaults():
#         return []
# 
# Path: pupillib/core/workers/processors/eye_processor.py
# class EyeDefaults():
#     @staticmethod
#     def pre_defaults():
#         return [
#             {
#                 'name': 'None',
#                 'config': {}
#             }
#         ]
# 
#     @staticmethod
#     def post_defaults():
#         return []
# 
# Path: pupillib/core/workers/processors/trial_processor.py
# class TrialDefaults():
#     @staticmethod
#     def pre_defaults():
#         return [
#             {
#                 'name': 'None',
#                 'config': {}
#             }
#         ]
# 
#     @staticmethod
#     def post_defaults():
#         return [
#             #{
#             #    'name': 'rm_zero_value_trials',
#             #    'config': [{'zeros_to_count': 4}, {'digit_tolerance': 0}]
#             #},
#             #{
#             #    'name': 'filter_moving_average',
#             #    'config': [{'window_size': 5}]
#             #},
#             {
#                 'name': 'filter_fft',
#                 'config': [{'highest_freq': 2}, {'lowest_freq': 0}]
#             }
#         ]
# 
# Path: pupillib/core/workers/processors/trigger_processor.py
# class TriggerDefaults():
#     @staticmethod
#     def pre_defaults():
#         return []
# 
#     @staticmethod
#     def post_defaults():
#         return [{'name': 'custom_resample', 'config': [{'srate': 256}]},
#                 {'name': 'rm_baseline', 'config': []},
#                 {'name': 'get_percent_change', 'config': []}]


# Path: pupillib/core/plib_parser.py
import argparse
import copy
import math
import sys
import warnings
import os
import ruamel.yaml as yaml
from pupillib.core.workers.processors.dataset_processor import DatasetDefaults
from pupillib.core.workers.processors.eye_processor import EyeDefaults
from pupillib.core.workers.processors.trial_processor import TrialDefaults
from pupillib.core.workers.processors.trigger_processor import TriggerDefaults


                        all_info[eye_config_name] = copy.deepcopy(eye_info)
                if len(data_name_per_dataset[dataset_config_name]) == 0:
                    data_name_per_dataset[dataset_config_name] = ['eye0', 'eye1']

                all_info[dataset_config_name] = copy.deepcopy(dataset_info)
        # If no datasets were found.
        if not all_info:
            raise Exception("Error: No datasets given.")

        self.config['datasets'] = dataset_names
        self.config['data_name_per_dataset'] = data_name_per_dataset
        self.config['parsed_yaml'] = all_info

        if yaml_path:
            self.config = self.parse_processing_defaults(self.config)

    def parse_processing_defaults(self, data_dict):
        def choose_defaults(level, position):
            return {
                'dataset': {
                    'pre_processing': DatasetDefaults.pre_defaults(),
                    'post_processing': DatasetDefaults.post_defaults(),
                },
                'eye': {
                    'pre_processing': EyeDefaults.pre_defaults(),
                    'post_processing': EyeDefaults.post_defaults(),
                },
                'trigger': {
                    'pre_processing': TriggerDefaults.pre_defaults(),

                    'post_processing': TriggerDefaults.post_defaults(),