Skip to content

Commit 921bb64

Browse files
committed
added docstrings
1 parent ad32bd6 commit 921bb64

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/test_id_estimation/test_gride.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_compute_id_gride():
4848

4949

5050
def test_zero_dist():
51+
"""Test that a warning message appear if there are overlapping datapoints."""
5152
X = np.array([[0, 0, 0], [0, 0, 0], [0.9, 0, 0]])
5253
de = IdEstimation(coordinates=X)
5354

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1+
# Copyright 2021-2022 The DADApy Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
16+
"""Module for testing utils functions"""
17+
18+
119
import numpy as np
220
import pytest
321

422
from dadapy._utils import utils
523

624

725
def test_zero_dist():
26+
"""Test that a warning message appear if there are overlapping datapoints."""
827
X = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.9, 0.0, 0.0]])
928
with pytest.warns(UserWarning):
1029
utils.compute_nn_distances(X, maxk=2, metric="euclidean", period=None)

0 commit comments

Comments
 (0)