@@ -77,6 +77,9 @@ def test_compositional_data_invalid():
77
77
def test_check_for_simplex_sample_space ():
78
78
"""Test whether or not a dataframe belongs to a simplex sample space is correctly identified."""
79
79
unit_simplex_df = pd .DataFrame ([[0.1 , 0.2 , 0.3 , 0.4 ], [0.2 , 0.3 , 0.2 , 0.3 ]])
80
+ closed_to_hundred_df = unit_simplex_df * 100
81
+ closed_to_million_df = unit_simplex_df * 1e6
82
+ closed_to_billion_df = unit_simplex_df * 1e9
80
83
non_simplex_positive_df = pd .DataFrame ([1 , 2 , 3 , 4 ], [5 , 6 , 7 , 8 ])
81
84
non_positive_df = pd .DataFrame ([- 1 , 2 , 3 , 4 ], [1 , 2 , 3 , 4 ])
82
85
@@ -91,3 +94,18 @@ def test_check_for_simplex_sample_space():
91
94
check_in_simplex_sample_space (unit_simplex_df )
92
95
except Exception as ex :
93
96
assert False , f"{ type (ex )} : { ex } "
97
+
98
+ try :
99
+ check_in_simplex_sample_space (closed_to_hundred_df )
100
+ except Exception as ex :
101
+ assert False , f"{ type (ex )} : { ex } "
102
+
103
+ try :
104
+ check_in_simplex_sample_space (closed_to_million_df )
105
+ except Exception as ex :
106
+ assert False , f"{ type (ex )} : { ex } "
107
+
108
+ try :
109
+ check_in_simplex_sample_space (closed_to_billion_df )
110
+ except Exception as ex :
111
+ assert False , f"{ type (ex )} : { ex } "
0 commit comments