Skip to content

Commit

Permalink
fix: amend message commit
Browse files Browse the repository at this point in the history
Signed-off-by: slowy07 <[email protected]>
  • Loading branch information
slowy07 committed Jan 24, 2024
1 parent f444a53 commit a0a63c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion OpenSeries/matematika.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def permutasi(nilai: int, r: int) -> Union[int, float, str]:
if isinstance(faktorial_nilai, str) or isinstance(faktorial_nilai_r, str):
return pesan_error.error_tipe_data(["int"])
else:
return faktorial_nilai_r / faktorial_nilai_r
return faktorial_nilai / faktorial_nilai_r


def kombinasi(nilai: int, r: int) -> Union[int, float, str]:
Expand Down
10 changes: 5 additions & 5 deletions testing/statistika_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
class TestFungsiEntropy(unittest.TestCase):
def test_entropy_dengan_none(self):
label = [1, 1, 2, 2, 3, 3]
hasil = statistika.entropy(label)
self.assertFalse(np.allclose(hasil, 1.584962500721156))
hasil = statistika.entropy(label, base=2)
self.assertTrue(np.allclose(hasil, 1.584962500721156))

def test_nilai_kosong(self):
label = []
hasil = statistika.entropy(label)
hasil = statistika.entropy(label, base=2)
self.assertEqual(hasil, pesan_error.error_format("label tidak boleh kosong"))

def test_nilai_element_dalam_label(self):
label = [1, 2, "3", 4]
hasil = statistika.entropy(label)
hasil = statistika.entropy(label, base=2)
self.assertEqual(hasil, pesan_error.error_tipe_data(["int"]))

def test_tipe_data_tuple(self):
label = (1, 2, 3)
hasil = statistika.entropy(label)
hasil = statistika.entropy(label, base=2)
self.assertEqual(hasil, pesan_error.error_tipe_data(["list"]))


Expand Down

0 comments on commit a0a63c4

Please sign in to comment.