# Path: rvic/core/convolution_wrapper.py
# SHAREDOBJECT = 'rvic_convolution' + sysconfig.get_config_var('SO')
# LIBPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))


import pytest
import numpy as np
from rvic.core.convolution_wrapper import rvic_convolve


def test_convolution_wraper():
    n_sources = 4
    n_outlets = 2
    time_length = 6
    ysize = 10
    xsize = 10
    source2outlet_ind = np.array([0, 0, 1, 1], dtype=np.int32)
    source_y_ind = np.array([2, 4, 6, 8], dtype=np.int32)
    source_x_ind = np.array([2, 6, 3, 5], dtype=np.int32)
    source_time_offset = np.zeros(n_sources, dtype=np.int32)
    unit_hydrograph = np.array([[0., 1., 0.5, 0.25],
                                [1., 0., 0.5, 0.25],
                                [0., 0., 0., 0.25],
                                [0., 0., 0., 0.25],
                                [0., 0., 0., 0.],
                                [0., 0., 0., 0.]])
    aggrunin = np.ones((ysize, xsize), dtype=np.float64)
    ring = np.zeros((time_length, n_outlets))


# Path: rvic/core/convolution_wrapper.py
# SHAREDOBJECT = 'rvic_convolution' + sysconfig.get_config_var('SO')
# LIBPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))


# Path: tests/unit/test_convolution_wrapper.py
import pytest
import numpy as np
from rvic.core.convolution_wrapper import rvic_convolve



def test_convolution_wraper():
    n_sources = 4
    n_outlets = 2
    time_length = 6
    ysize = 10
    xsize = 10
    source2outlet_ind = np.array([0, 0, 1, 1], dtype=np.int32)
    source_y_ind = np.array([2, 4, 6, 8], dtype=np.int32)
    source_x_ind = np.array([2, 6, 3, 5], dtype=np.int32)
    source_time_offset = np.zeros(n_sources, dtype=np.int32)
    unit_hydrograph = np.array([[0., 1., 0.5, 0.25],
                                [1., 0., 0.5, 0.25],
                                [0., 0., 0., 0.25],
                                [0., 0., 0., 0.25],
                                [0., 0., 0., 0.],
                                [0., 0., 0., 0.]])
    aggrunin = np.ones((ysize, xsize), dtype=np.float64)
    ring = np.zeros((time_length, n_outlets))


    rvic_convolve(n_sources,