Skip to content

Commit 90f42c9

Browse files
author
Onno Kampman
committed
add test for lower triangular indices tuples
1 parent b45afea commit 90f42c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/fcest/helpers/test_array_operations.py

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import tensorflow as tf
66

77
from fcest.helpers.array_operations import are_all_positive_definite
8+
from fcest.helpers.array_operations import get_all_lower_triangular_indices_tuples
89
from fcest.helpers.array_operations import to_correlation_structure
910

1011

@@ -64,6 +65,14 @@ def test_assert_positive_definite_symmetric_positive_definite(self):
6465
matrices = tf.constant(matrices, dtype=tf.dtypes.float64)
6566
self.assertTrue(are_all_positive_definite(matrices))
6667

68+
def test_get_all_lower_triangular_indices_tuples(self):
69+
lower_triangular_indices = get_all_lower_triangular_indices_tuples(
70+
num_time_series=3
71+
)
72+
true_tuples_list = [(1, 0), (2, 0), (2, 1)]
73+
self.assertEqual(type(lower_triangular_indices), list)
74+
self.assertEqual(lower_triangular_indices, true_tuples_list)
75+
6776
def test_to_correlation_structure(self):
6877
"""
6978
Test identical covariance and correlation structures.

0 commit comments

Comments
 (0)