|
2 | 2 | import pandas as pd |
3 | 3 | from ideeplc.data_initialize import data_initialize |
4 | 4 |
|
| 5 | + |
5 | 6 | def test_data_initialize(): |
6 | 7 | """Test the data_initialize function.""" |
7 | | - test_csv_path = "ideeplc/example_input/Hela_deeprt.csv" # Path to a sample test CSV file |
| 8 | + test_csv_path = ( |
| 9 | + "ideeplc/example_input/Hela_deeprt.csv" # Path to a sample test CSV file |
| 10 | + ) |
8 | 11 | matrix_input, x_shape = data_initialize(csv_path=test_csv_path) |
9 | 12 |
|
10 | 13 | df_3 = pd.DataFrame(matrix_input[3][0]) |
11 | | - expected = pd.DataFrame({ |
12 | | - 1: [1.286264, 0.209934, 12.0, 23.0, 2.0, 5.0], |
13 | | - 2: [-1.076330, -2.715786, 6.0, 11.0, 7.0, 2.0], |
14 | | - 3: [-1.435417, 1.267611, 14.0, 16.0, 4.0, 2.0], |
15 | | - 4: [-1.280370, -2.870834, 6.0, 10.0, 4.0, 2.0] |
16 | | - }, index=[0, 1, 2, 3, 4, 5]) |
| 14 | + expected = pd.DataFrame( |
| 15 | + { |
| 16 | + 1: [1.286264, 0.209934, 12.0, 23.0, 2.0, 5.0], |
| 17 | + 2: [-1.076330, -2.715786, 6.0, 11.0, 7.0, 2.0], |
| 18 | + 3: [-1.435417, 1.267611, 14.0, 16.0, 4.0, 2.0], |
| 19 | + 4: [-1.280370, -2.870834, 6.0, 10.0, 4.0, 2.0], |
| 20 | + }, |
| 21 | + index=[0, 1, 2, 3, 4, 5], |
| 22 | + ) |
17 | 23 |
|
18 | 24 | pd.testing.assert_frame_equal(df_3.iloc[:6, 1:5], expected, check_dtype=False) |
19 | 25 | assert matrix_input is not None, "Matrix input should not be None" |
20 | 26 | assert isinstance(x_shape, tuple), "x_shape should be a tuple" |
21 | 27 | assert x_shape == (1, 41, 62), "Expected shape of x is (1, 41, 62)" |
22 | | - |
|
0 commit comments