Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gsheni committed May 1, 2024
1 parent ff5ced1 commit 4d505b6
Show file tree
Hide file tree
Showing 37 changed files with 55 additions and 27 deletions.
1 change: 0 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import sys
from pathlib import Path

from packaging.version import Version
import tomli
from invoke import task
from packaging.requirements import Requirement
Expand Down
1 change: 1 addition & 0 deletions tests/end-to-end/bivariate/test_base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import pytest

from copulas.bivariate import Bivariate


Expand Down
1 change: 1 addition & 0 deletions tests/end-to-end/multivariate/test_base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import pytest

from copulas.datasets import sample_trivariate_xyz
from copulas.multivariate import GaussianMultivariate, VineCopula

Expand Down
1 change: 1 addition & 0 deletions tests/end-to-end/multivariate/test_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import numpy as np
import pandas as pd

from copulas.datasets import sample_trivariate_xyz
from copulas.multivariate import GaussianMultivariate
from copulas.univariate import BetaUnivariate, GaussianKDE, ParametricType, Univariate
Expand Down
1 change: 1 addition & 0 deletions tests/end-to-end/test___init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from copulas import random_state


Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/univariate/test_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate import BetaUnivariate
from scipy.stats import beta

from copulas.univariate import BetaUnivariate


class TestGaussian(TestCase):
def setUp(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/univariate/test_gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate import GammaUnivariate
from scipy.stats import gamma

from copulas.univariate import GammaUnivariate


class TestGaussian(TestCase):
def setUp(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/univariate/test_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate import GaussianUnivariate
from scipy.stats import norm

from copulas.univariate import GaussianUnivariate


class TestGaussian(TestCase):
def setUp(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/univariate/test_gaussian_kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from unittest import TestCase

import numpy as np
from scipy.stats import ks_2samp, norm, randint

from copulas.datasets import sample_univariate_bimodal
from copulas.multivariate import GaussianMultivariate
from copulas.univariate.gaussian_kde import GaussianKDE
from scipy.stats import ks_2samp, norm, randint


class TestGaussian(TestCase):
Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/univariate/test_student_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate import StudentTUnivariate
from scipy.stats import t

from copulas.univariate import StudentTUnivariate


class TestStudentT(TestCase):
def setUp(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/univariate/test_truncated_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate import TruncatedGaussian
from scipy.stats import truncnorm

from copulas.univariate import TruncatedGaussian


class TestGaussian(TestCase):
def setUp(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/large_scale_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
import tabulate
from botocore import UNSIGNED
from botocore.client import Config
from scipy.stats import ks_2samp

from copulas import get_instance
from copulas.multivariate import GaussianMultivariate, VineCopula
from copulas.univariate import GaussianUnivariate
from scipy.stats import ks_2samp

LOGGER = logging.getLogger(__name__)

Expand Down
1 change: 1 addition & 0 deletions tests/numerical/cdf/test_cdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import pandas as pd
import pytest

from copulas import get_instance

BASE = os.path.dirname(__file__)
Expand Down
1 change: 1 addition & 0 deletions tests/numerical/fit/test_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import pandas as pd
import pytest

from copulas import get_instance

BASE = os.path.dirname(__file__)
Expand Down
1 change: 1 addition & 0 deletions tests/numerical/pdf/test_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import pandas as pd
import pytest

from copulas import get_instance

BASE = os.path.dirname(__file__)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/bivariate/test___init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import numpy as np
from scipy import stats

from copulas.bivariate import select_copula
from copulas.bivariate.frank import Frank
from scipy import stats


def test_select_copula_negative_tau():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/bivariate/test_base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from unittest import TestCase, mock

import numpy as np
from copulas.bivariate.base import Bivariate, CopulaTypes

from copulas.bivariate.base import Bivariate, CopulaTypes
from tests import compare_nested_dicts


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/bivariate/test_clayton.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from unittest import TestCase

import numpy as np
from copulas.bivariate.clayton import Clayton

from copulas.bivariate.clayton import Clayton
from tests import copula_single_arg_not_one, copula_zero_if_arg_zero


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/bivariate/test_frank.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from unittest.mock import patch

import numpy as np
from copulas.bivariate.frank import Frank

from copulas.bivariate.frank import Frank
from tests import compare_nested_iterables, copula_single_arg_not_one, copula_zero_if_arg_zero


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/bivariate/test_gumbel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from unittest.mock import patch

import numpy as np
from copulas.bivariate.gumbel import Gumbel

from copulas.bivariate.gumbel import Gumbel
from tests import compare_nested_iterables, copula_single_arg_not_one, copula_zero_if_arg_zero


Expand Down
1 change: 1 addition & 0 deletions tests/unit/bivariate/test_independence.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest import TestCase

import numpy as np

from copulas.bivariate.independence import Independence


Expand Down
1 change: 1 addition & 0 deletions tests/unit/multivariate/test_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from copulas.multivariate.base import Multivariate


Expand Down
1 change: 1 addition & 0 deletions tests/unit/multivariate/test_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pandas as pd

from copulas import get_qualified_name
from copulas.multivariate.gaussian import GaussianMultivariate
from copulas.univariate import GaussianUnivariate
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/multivariate/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import numpy as np
import pandas as pd
import pytest

from copulas import EPSILON
from copulas.bivariate import CopulaTypes
from copulas.multivariate.tree import Edge, Tree, TreeTypes, get_tree
from copulas.univariate.gaussian_kde import GaussianKDE

from tests import compare_nested_dicts, compare_nested_iterables, compare_values_epsilon


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/multivariate/test_vine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import numpy as np
import pandas as pd
import pytest

from copulas.multivariate.tree import TreeTypes
from copulas.multivariate.vine import VineCopula

from tests import compare_nested_dicts, compare_nested_iterables


Expand Down
1 change: 1 addition & 0 deletions tests/unit/optimize/test___init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest import TestCase

import numpy as np

from copulas.optimize import bisect, chandrupatla


Expand Down
5 changes: 3 additions & 2 deletions tests/unit/test___init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
from unittest import TestCase
from unittest.mock import MagicMock, call, patch

import copulas
import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_array_equal

import copulas
from copulas import (
_find_addons,
check_valid_values,
Expand All @@ -16,7 +18,6 @@
vectorize,
)
from copulas.multivariate import GaussianMultivariate
from numpy.testing import assert_array_equal


class TestVectorize(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/univariate/test_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import patch

import numpy as np

from copulas.univariate.base import BoundedType, ParametricType, Univariate
from copulas.univariate.beta import BetaUnivariate
from copulas.univariate.gamma import GammaUnivariate
Expand All @@ -10,7 +11,6 @@
from copulas.univariate.student_t import StudentTUnivariate
from copulas.univariate.truncated_gaussian import TruncatedGaussian
from copulas.univariate.uniform import UniformUnivariate

from tests import compare_nested_iterables


Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
from unittest.mock import patch

import numpy as np
from copulas.univariate import BetaUnivariate
from scipy.stats import beta

from copulas.univariate import BetaUnivariate


class TestBetaUnivariate(TestCase):
def test__fit_constant(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_gamma.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate import GammaUnivariate
from scipy.stats import gamma

from copulas.univariate import GammaUnivariate


class TestGammaUnivariate(TestCase):
def test__fit_constant(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_gaussian.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate.gaussian import GaussianUnivariate
from scipy.stats import norm

from copulas.univariate.gaussian import GaussianUnivariate


class TestGaussianUnivariate(TestCase):
def test__fit_constant(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_gaussian_kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import numpy as np
import pytest
from scipy.stats import gaussian_kde

from copulas.datasets import sample_univariate_bimodal
from copulas.univariate.gaussian_kde import GaussianKDE
from scipy.stats import gaussian_kde


class TestGaussianKDE(TestCase):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_log_laplace.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate import LogLaplace
from scipy.stats import loglaplace

from copulas.univariate import LogLaplace


class TestLogLaplaceUnivariate(TestCase):
def test__fit_constant(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_selection.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from unittest.mock import Mock, patch

import numpy as np
from scipy.stats import truncnorm

from copulas.univariate import BetaUnivariate, GaussianKDE, GaussianUnivariate, TruncatedGaussian
from copulas.univariate.selection import select_univariate
from scipy.stats import truncnorm


def test_select_univariate_bimodal():
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_student_t.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate.student_t import StudentTUnivariate
from scipy.stats import t

from copulas.univariate.student_t import StudentTUnivariate


class TestStudentTUnivariate(TestCase):
def test__fit(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_truncated_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from unittest.mock import patch

import numpy as np
from copulas.univariate.truncated_gaussian import TruncatedGaussian
from scipy.stats import truncnorm

from copulas.univariate.truncated_gaussian import TruncatedGaussian


class TestTruncatedGaussian(TestCase):
def test__fit_constant(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/univariate/test_uniform.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from unittest import TestCase

import numpy as np
from copulas.univariate.uniform import UniformUnivariate
from scipy.stats import uniform

from copulas.univariate.uniform import UniformUnivariate


class TestUniformUnivariate(TestCase):
def test__fit_constant(self):
Expand Down

0 comments on commit 4d505b6

Please sign in to comment.