From 68f31fb714efffce08f66a6613ae88581558ecb9 Mon Sep 17 00:00:00 2001 From: Arnor Sigurdsson Date: Sun, 27 Aug 2023 06:19:53 -0600 Subject: [PATCH] Update tests. --- .../test_prepare_omics.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test_data_load/test_data_preparation_modules/test_prepare_omics.py b/tests/test_data_load/test_data_preparation_modules/test_prepare_omics.py index a2921fb9..a25928d9 100644 --- a/tests/test_data_load/test_data_preparation_modules/test_prepare_omics.py +++ b/tests/test_data_load/test_data_preparation_modules/test_prepare_omics.py @@ -19,7 +19,7 @@ def test_prepare_genotype_array_train_mode(): na_augment_perc=1.0, na_augment_prob=1.0, shuffle_augment_perc=1.0, - shuffle_augment_prob=1.0, + shuffle_augment_prob=0.0, test_mode=False, ) @@ -28,6 +28,20 @@ def test_prepare_genotype_array_train_mode(): assert (prepared_array_train[:, -1, :] == 1).all() + prepared_array_train = prepare_omics.prepare_one_hot_omics_data( + genotype_array=test_array, + na_augment_perc=1.0, + na_augment_prob=1.0, + shuffle_augment_perc=1.0, + shuffle_augment_prob=1.0, + test_mode=False, + ) + + assert prepared_array_train != test_array + assert (test_array_copy == test_array).all() + + assert (prepared_array_train[:, -1, :] != 1).any() + def test_prepare_genotype_array_test_mode(): test_array = torch.zeros((1, 4, 100), dtype=torch.uint8).detach().numpy()