# Path: msibi/utils/error_calculation.py
# def calc_similarity(arr1, arr2):
#     f_fit = np.sum(np.absolute(arr1 - arr2))
#     f_fit /= np.sum((np.absolute(arr1) + np.absolute(arr2)))
#     return 1.0 - f_fit


import numpy as np
from msibi.utils.error_calculation import calc_similarity



def test_calc_similarity():
    arr1 = np.ones(10)
    arr2 = np.ones(10)
    f_fit = calc_similarity(arr1, arr2)
    assert f_fit == 1.0

    arr2 = np.zeros(10)

# Path: msibi/utils/error_calculation.py
# def calc_similarity(arr1, arr2):
#     f_fit = np.sum(np.absolute(arr1 - arr2))
#     f_fit /= np.sum((np.absolute(arr1) + np.absolute(arr2)))
#     return 1.0 - f_fit


# Path: msibi/tests/test_error_calculation.py
import numpy as np
from msibi.utils.error_calculation import calc_similarity




def test_calc_similarity():
    arr1 = np.ones(10)
    arr2 = np.ones(10)
    f_fit = calc_similarity(arr1, arr2)
    assert f_fit == 1.0

    arr2 = np.zeros(10)

    f_fit = calc_similarity(arr1, arr2)