Skip to content

test_h12_calibration failure #677

@leehart

Description

@leehart
=================================== FAILURES ===================================
________________________ test_h12_calibration[af1_sim] _________________________

fixture = <tests.anoph.conftest.Af1Simulator object at 0x7fe234de2690>
api = <malariagen_data.anoph.h12.AnophelesH12Analysis object at 0x7fe22045c250>

    @parametrize_with_cases("fixture,api", cases=".")
    def test_h12_calibration(fixture, api: AnophelesH12Analysis):
        # Set up test parameters.
        all_sample_sets = api.sample_sets()["sample_set"].to_list()
        window_sizes = np.random.randint(100, 500, size=random.randint(2, 5)).tolist()
        window_sizes = sorted([int(x) for x in window_sizes])
        h12_params = dict(
            contig=random.choice(api.contigs),
            sample_sets=[random.choice(all_sample_sets)],
            window_sizes=window_sizes,
            min_cohort_size=5,
        )
    
        # Run function under test.
        calibration_runs = api.h12_calibration(**h12_params)
    
        # Check results.
        assert isinstance(calibration_runs, dict)
>       assert len(calibration_runs) == len(window_sizes)
E       AssertionError: assert 4 == 5
E        +  where 4 = len({'118': array([0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.01...5,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125]), '489': array([0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125])})
E        +  and   5 = len([118, 146, 146, 312, 489])

tests/anoph/test_h12.py:117: AssertionError
----------------------------- Captured stdout call -----------------------------



Access haplotypes: ⠋ (0:00:00.00)
                                  



Save results to cache: ⠋ (0:00:00.00)
                                      
----------------------------- Captured stderr call -----------------------------

Load haplotypes:   0%|          | 0/8 [00:00<?, ?it/s]
                                                      

Compute H12:   0%|          | 0/5 [00:00<?, ?it/s]
                                                  
=========================== short test summary info ============================
FAILED tests/anoph/test_h12.py::test_h12_calibration[af1_sim] - AssertionError: assert 4 == 5
 +  where 4 = len({'118': array([0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.01...5,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125]), '489': array([0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125, 0.0128125,\n       0.0128125, 0.0128125, 0.0128125, 0.0128125])})
 +  and   5 = len([118, 146, 146, 312, 489])
================== 1 failed, 423 passed in 222.94s (0:03:42) ===================
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions