|
10 | 10 | import os
|
11 | 11 |
|
12 | 12 |
|
13 |
| -def test_heatmaps_for_current_model(plot_paths_fixture, config) -> None: |
14 |
| - """Test that the model in the config has folders and files saved in the plots folder.""" |
15 |
| - # Get the plotting path |
16 |
| - plots_path = plot_paths_fixture[0] |
17 |
| - |
18 |
| - # Get the path to the model currently in the config |
19 |
| - model = config.model |
20 |
| - model_folder = plots_path / model |
21 |
| - |
22 |
| - # Check that the model folder exists |
23 |
| - assert model_folder.exists() |
24 |
| - assert model_folder.is_dir() |
25 |
| - |
26 |
| - # Check that the model folder contains a subfolder for the number of evaluated red herring clues |
27 |
| - n_red_herring_clues_evaluated = config.n_red_herring_clues_evaluated |
28 |
| - red_herring_folder = model_folder / f"{n_red_herring_clues_evaluated}rh" |
29 |
| - assert red_herring_folder.exists() |
30 |
| - assert red_herring_folder.is_dir() |
| 13 | +class TestHeatmapsForCurrentModel: |
| 14 | + """Tests related to heatmaps for the current model.""" |
| 15 | + |
| 16 | + def test_model_plot_folder_exists(self, plot_paths_fixture, config) -> None: |
| 17 | + """Test that the model in the config has a folder in the plots folder.""" |
| 18 | + # Get the path to the model currently in the config |
| 19 | + model_folder = plot_paths_fixture[2] |
| 20 | + |
| 21 | + # Check that the model folder exists |
| 22 | + assert model_folder.exists() |
| 23 | + assert model_folder.is_dir() |
| 24 | + |
| 25 | + def test_red_herring_plot_folder_exists(self, plot_paths_fixture, config) -> None: |
| 26 | + """Test that the model in the config has a folder for the chosen number of evaluated red herrings in the plots folder.""" |
| 27 | + # Get the path to the model and number of evaluated red herring clues currently in the config |
| 28 | + red_herring_folder = plot_paths_fixture[3] |
| 29 | + |
| 30 | + # Check that the model folder contains a subfolder for the number of evaluated red herring clues |
| 31 | + assert red_herring_folder.exists() |
| 32 | + assert red_herring_folder.is_dir() |
| 33 | + |
| 34 | + def test_heatmaps_for_current_model(self, plot_paths_fixture, config) -> None: |
| 35 | + """Test that the cell score heatmap for the current evaluation is saved in the plots folder.""" |
| 36 | + # Get the path to the model and number of evaluated red herring clues currently in the config |
| 37 | + red_herring_folder = plot_paths_fixture[3] |
| 38 | + |
| 39 | + # Get the path to the model currently in the config |
| 40 | + model = config.model |
| 41 | + n_red_herring_clues_evaluated = config.n_red_herring_clues_evaluated |
31 | 42 |
|
32 |
| - # Check that the folder contains the expected cell score file |
33 |
| - n_puzzles = config.n_puzzles |
34 |
| - cell_score_plot_filename = f"mean_cell_score_{model}_{n_red_herring_clues_evaluated}rh_{n_puzzles}_puzzles.png" |
35 |
| - cell_score_plot_file_path = red_herring_folder / cell_score_plot_filename |
| 43 | + # Check that the folder contains the expected cell score file |
| 44 | + n_puzzles = config.n_puzzles |
| 45 | + cell_score_plot_filename = f"mean_cell_score_{model}_{n_red_herring_clues_evaluated}rh_{n_puzzles}_puzzles.png" |
| 46 | + cell_score_plot_file_path = red_herring_folder / cell_score_plot_filename |
36 | 47 |
|
37 |
| - assert cell_score_plot_file_path.exists() |
38 |
| - assert cell_score_plot_file_path.is_file() |
39 |
| - assert os.path.getsize(cell_score_plot_file_path) > 0 |
| 48 | + assert cell_score_plot_file_path.exists() |
| 49 | + assert cell_score_plot_file_path.is_file() |
| 50 | + assert os.path.getsize(cell_score_plot_file_path) > 0 |
40 | 51 |
|
41 | 52 |
|
42 | 53 | def test_clue_type_difficulty_plot(plot_paths_fixture, config) -> None:
|
|
0 commit comments