# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


import unittest
import numpy as np
from numpy import fft
from blond.utils import bmath as bm

    def setUp(self):
        np.random.seed(0)
        bm.use_fftw()
        pass

    # Run after every test
    def tearDown(self):
        pass

    def test_rfft_1(self):
        s = np.random.randn(10)
        try:
            res = bm.rfft(s)
        except AttributeError as e:
            self.skipTest('Not compiled with FFTW')

        np.testing.assert_almost_equal(res, fft.rfft(s), 8)

    def test_rfft_2(self):
        s = np.random.randn(100)
        try:
            res = bm.rfft(s)
        except AttributeError as e:
            self.skipTest('Not compiled with FFTW')

        np.testing.assert_almost_equal(res, fft.rfft(s), 8)

    def test_rfft_3(self):
        s = np.random.randn(93)
        try:

# Path: blond/utils/bmath.py
# def use_mpi():
# def mpiMode():
# def use_fftw():
# def use_precision(_precision='double'):
# def update_active_dict(new_dict):


# Path: unittests/utils/test_ffts.py
import unittest
import numpy as np
from numpy import fft
from blond.utils import bmath as bm

    def setUp(self):
        np.random.seed(0)
        bm.use_fftw()
        pass

    # Run after every test
    def tearDown(self):
        pass

    def test_rfft_1(self):
        s = np.random.randn(10)
        try:
            res = bm.rfft(s)
        except AttributeError as e:
            self.skipTest('Not compiled with FFTW')

        np.testing.assert_almost_equal(res, fft.rfft(s), 8)

    def test_rfft_2(self):
        s = np.random.randn(100)
        try:
            res = bm.rfft(s)
        except AttributeError as e:
            self.skipTest('Not compiled with FFTW')

        np.testing.assert_almost_equal(res, fft.rfft(s), 8)

    def test_rfft_3(self):
        s = np.random.randn(93)
        try:

            res = bm.rfft(s)
