# Path: spykeutils/_scipy_quantities.py
# def _fix_binary_scipy_function_with_out_param(f):
#     def _fixed(x1, x2, out=None):
# def _fix_scipy_meshgrid(f):
#     def _fixed(x, y):
# def _fix_scipy_concatenate(f):
#     def _fixed(arrays, axis=0):
# def _fix_binary_scipy_function(f):
#     def _fixed(x1, x2):
# def diag(v, k=0):
# def linspace(start, stop, num=50, endpoint=True, retstep=False):


    import unittest2 as ut
    import unittest as ut
import scipy as sp
import quantities as pq
from itertools import combinations
from numpy.testing import assert_array_equal, assert_array_almost_equal
from spykeutils import _scipy_quantities as spq
        assert out.units == pq.s
        spq.maximum(a, b, out)
        assert_array_almost_equal(expected, out)
        spq.maximum(b, a, out)
        assert_array_almost_equal(expected, out)


class TestScipyMinimum(ut.TestCase):
    def test_works_with_normal_arrays(self):
        a = sp.array([[4, 2], [2, 4]])
        b = sp.array([[3, 3], [3, 3]])
        expected = sp.array([[3, 2], [2, 3]])
        actual = spq.minimum(a, b)
        assert_array_equal(expected, actual)

    def test_works_with_quantity_arrays(self):
        a = sp.array([[4, 2], [2, 4]]) * pq.s
        b = sp.array([[3000, 3000], [3000, 3000]]) * pq.ms
        expected = sp.array([[3, 2], [2, 3]]) * pq.s
        actual = spq.minimum(a, b)
        assert_array_almost_equal(expected, actual)
        actual = spq.minimum(b, a)
        assert_array_almost_equal(expected, actual)

    def test_works_with_normal_and_quantity_arrays_mixed(self):
        a = sp.array([[4, 2], [2, 4]])
        b = sp.array([[3, 3], [3, 3]]) * pq.dimensionless
        expected = sp.array([[3, 2], [2, 3]]) * pq.dimensionless
        actual = spq.minimum(a, b)
        assert_array_almost_equal(expected, actual)

# Path: spykeutils/_scipy_quantities.py
# def _fix_binary_scipy_function_with_out_param(f):
#     def _fixed(x1, x2, out=None):
# def _fix_scipy_meshgrid(f):
#     def _fixed(x, y):
# def _fix_scipy_concatenate(f):
#     def _fixed(arrays, axis=0):
# def _fix_binary_scipy_function(f):
#     def _fixed(x1, x2):
# def diag(v, k=0):
# def linspace(start, stop, num=50, endpoint=True, retstep=False):


# Path: spykeutils/tests/test_scipy_quantities.py
    import unittest2 as ut
    import unittest as ut
import scipy as sp
import quantities as pq
from itertools import combinations
from numpy.testing import assert_array_equal, assert_array_almost_equal
from spykeutils import _scipy_quantities as spq

        assert out.units == pq.s
        spq.maximum(a, b, out)
        assert_array_almost_equal(expected, out)
        spq.maximum(b, a, out)
        assert_array_almost_equal(expected, out)


class TestScipyMinimum(ut.TestCase):
    def test_works_with_normal_arrays(self):
        a = sp.array([[4, 2], [2, 4]])
        b = sp.array([[3, 3], [3, 3]])
        expected = sp.array([[3, 2], [2, 3]])
        actual = spq.minimum(a, b)
        assert_array_equal(expected, actual)

    def test_works_with_quantity_arrays(self):
        a = sp.array([[4, 2], [2, 4]]) * pq.s
        b = sp.array([[3000, 3000], [3000, 3000]]) * pq.ms
        expected = sp.array([[3, 2], [2, 3]]) * pq.s
        actual = spq.minimum(a, b)
        assert_array_almost_equal(expected, actual)
        actual = spq.minimum(b, a)
        assert_array_almost_equal(expected, actual)

    def test_works_with_normal_and_quantity_arrays_mixed(self):
        a = sp.array([[4, 2], [2, 4]])
        b = sp.array([[3, 3], [3, 3]]) * pq.dimensionless
        expected = sp.array([[3, 2], [2, 3]]) * pq.dimensionless
        actual = spq.minimum(a, b)
        assert_array_almost_equal(expected, actual)

        actual = spq.minimum(b, a)