Skip to content

Flaky PCA test #452

@tristan-f-r

Description

@tristan-f-r

This test_node_precision_recall_pca_chosen_pathway test (logs_51725883966.zip) is very flaky (failing a considerable amount of the time):

2025-12-08T20:08:27.4124818Z =================================== FAILURES ===================================
2025-12-08T20:08:27.4125344Z __________ TestEvaluate.test_node_precision_recall_pca_chosen_pathway __________
2025-12-08T20:08:27.4125658Z 
2025-12-08T20:08:27.4125823Z self = <test_evaluate.TestEvaluate object at 0x7f4157e3b950>
2025-12-08T20:08:27.4126070Z 
2025-12-08T20:08:27.4126225Z     def test_node_precision_recall_pca_chosen_pathway(self):
2025-12-08T20:08:27.4126642Z         output_file = Path(OUT_DIR + 'pr-per-pathway-pca-chosen.txt')
2025-12-08T20:08:27.4127024Z         output_file.unlink(missing_ok=True)
2025-12-08T20:08:27.4127407Z         output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen.png')
2025-12-08T20:08:27.4127775Z         output_png.unlink(missing_ok=True)
2025-12-08T20:08:27.4128129Z         output_coordinates = Path(OUT_DIR + 'pca-coordinates.tsv')
2025-12-08T20:08:27.4128748Z         output_coordinates.unlink(missing_ok=True)
2025-12-08T20:08:27.4129034Z     
2025-12-08T20:08:27.4129817Z         file_paths = [INPUT_DIR + 'data-test-params-123/pathway.txt', INPUT_DIR + 'data-test-params-456/pathway.txt',
2025-12-08T20:08:27.4130538Z                       INPUT_DIR + 'data-test-params-789/pathway.txt',  INPUT_DIR + 'data-test-params-empty/pathway.txt']
2025-12-08T20:08:27.4130985Z     
2025-12-08T20:08:27.4131226Z         dataframe = ml.summarize_networks(file_paths)
2025-12-08T20:08:27.4131817Z         ml.pca(dataframe, OUT_DIR + 'pca.png', OUT_DIR + 'pca-variance.txt', str(output_coordinates), kde=True, remove_empty_pathways=True)
2025-12-08T20:08:27.4132330Z     
2025-12-08T20:08:27.4132695Z         pathway = Evaluation.pca_chosen_pathway([output_coordinates], SUMMARY_FILE, INPUT_DIR)
2025-12-08T20:08:27.4133104Z     
2025-12-08T20:08:27.4133390Z         pr_df = Evaluation.node_precision_and_recall(pathway, GS_NODE_TABLE)
2025-12-08T20:08:27.4133923Z         Evaluation.precision_and_recall_pca_chosen_pathway(pr_df, output_file, output_png, True)
2025-12-08T20:08:27.4134353Z     
2025-12-08T20:08:27.4134506Z     
2025-12-08T20:08:27.4134770Z         chosen = pd.read_csv(output_file, sep='\t', header=0).round(8)
2025-12-08T20:08:27.4135344Z         expected = pd.read_csv(EXPECT_DIR + 'expected-pr-per-pathway-pca-chosen.txt', sep='\t',  header=0).round(8)
2025-12-08T20:08:27.4135822Z     
2025-12-08T20:08:27.4136018Z >       assert chosen.equals(expected)
2025-12-08T20:08:27.4136276Z E       assert False
2025-12-08T20:08:27.4136807Z E        +  where False = equals(                                             Pathway  Precision  Recall\n0  test/evaluate/input/data-test-params-123/pathw...   0.666667     0.5)
2025-12-08T20:08:27.4137584Z E        +    where equals =                                              Pathway  Precision  Recall\n0  test/evaluate/input/data-test-params-789/pathw...        1.0    0.75.equals
2025-12-08T20:08:27.4137979Z 
2025-12-08T20:08:27.4138095Z test/evaluate/test_evaluate.py:122: AssertionError
2025-12-08T20:08:27.4138465Z =========================== short test summary info ============================
2025-12-08T20:08:27.4138952Z FAILED test/evaluate/test_evaluate.py::TestEvaluate::test_node_precision_recall_pca_chosen_pathway - assert False
2025-12-08T20:08:27.4139628Z  +  where False = equals(                                             Pathway  Precision  Recall\n0  test/evaluate/input/data-test-params-123/pathw...   0.666667     0.5)
2025-12-08T20:08:27.4140316Z  +    where equals =                                              Pathway  Precision  Recall\n0  test/evaluate/input/data-test-params-789/pathw...        1.0    0.75.equals

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginfrastructuremisc. changes made to SPRAS itself

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions