Skip to content

Commit

Permalink
Add missing DEFAULT_SIGMA in MMD unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaime-cespedes-sisniega committed Dec 6, 2024
1 parent 373c1cc commit f019f52
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"""Test MMD."""

from functools import partial
from typing import Any, Optional, Tuple
from typing import (
Any,
Optional,
Tuple,
)

import numpy as np
import pytest
Expand Down Expand Up @@ -182,7 +186,10 @@ def test_mmd_chunk_size_initialization_valid(
X_ref = np.random.normal(0, 1, 100)
X_test = np.random.normal(0, 1, 100)

kernel = partial(rbf_kernel, sigma=DEFAULT_SIGMA)
kernel = partial(
rbf_kernel,
sigma=DEFAULT_SIGMA,
)

detector = MMD(
kernel=kernel,
Expand Down Expand Up @@ -213,7 +220,10 @@ def test_mmd_chunk_size_invalid(
:param chunk_size: chunk size to test
:type chunk_size: Any
"""
kernel = partial(rbf_kernel, sigma=0.5)
kernel = partial(
rbf_kernel,
sigma=DEFAULT_SIGMA,
)

with pytest.raises((TypeError, ValueError)):
MMD(
Expand Down

0 comments on commit f019f52

Please sign in to comment.