# Path: modality/flow_cytometry_interface.py
# def flow_cytometry_interface(fun):
#     def fun_with_fc_interface(*args, **kwargs):
# def infer_blur_delta(data):
# def preprocess_fcdata(data, ch_range=None, rm_extreme=True, blurring='fp',
#                       blur_delta='infer', return_list=False):


import unittest
import numpy as np
from modality import calibrated_diptest_fc, calibrated_bwtest_fc, \
    silverman_bwtest_fc, hartigan_diptest_fc, excess_mass_modes_fc,\
    preprocess_fcdata, infer_blur_delta
from __future__ import unicode_literals



class testFcInterface(unittest.TestCase):

    def setUp(self):
        self.data = np.random.randn(100)
        self.data_trunc = np.round(100*self.data)*.01
        self.data_trunc[self.data_trunc < 0] = 0
        self.ch_range = 0, np.max(self.data_trunc)
        self.blur_delta = infer_blur_delta(self.data_trunc)
        self.alpha = 0.05

    def test_fc_preprocessing(self):
        calibrated_diptest_fc(self.data, self.alpha, 'shoulder', blurring='none', rm_extreme=False)
        calibrated_diptest_fc(self.data_trunc, self.alpha, 'shoulder', blurring='fp')

# Path: modality/flow_cytometry_interface.py
# def flow_cytometry_interface(fun):
#     def fun_with_fc_interface(*args, **kwargs):
# def infer_blur_delta(data):
# def preprocess_fcdata(data, ch_range=None, rm_extreme=True, blurring='fp',
#                       blur_delta='infer', return_list=False):


# Path: tests/test_fc_interface.py
import unittest
import numpy as np
from modality import calibrated_diptest_fc, calibrated_bwtest_fc, \
    silverman_bwtest_fc, hartigan_diptest_fc, excess_mass_modes_fc,\
    preprocess_fcdata, infer_blur_delta

from __future__ import unicode_literals



class testFcInterface(unittest.TestCase):

    def setUp(self):
        self.data = np.random.randn(100)
        self.data_trunc = np.round(100*self.data)*.01
        self.data_trunc[self.data_trunc < 0] = 0
        self.ch_range = 0, np.max(self.data_trunc)
        self.blur_delta = infer_blur_delta(self.data_trunc)
        self.alpha = 0.05

    def test_fc_preprocessing(self):
        calibrated_diptest_fc(self.data, self.alpha, 'shoulder', blurring='none', rm_extreme=False)
        calibrated_diptest_fc(self.data_trunc, self.alpha, 'shoulder', blurring='fp')

        calibrated_diptest_fc(self.data_trunc, self.alpha, 'shoulder', blurring='fp_deterministic')