예제 #1
0
def test_calc_base_stats():
    count, mean, std = PhenoTool._calc_base_stats([1, 2, 3, 4, 5, 6, 7, 8, 9])
    assert count == 9
    assert mean == 5
    assert std == pytest.approx(1.686899413014786, abs=1e-15)
예제 #2
0
def test_join_pheno_df_with_empty_pheno_df():
    pheno_df = pd.DataFrame([], columns=["person_id", "measure_value"])
    variants = Counter({112233: 1})
    with pytest.raises(AssertionError):
        PhenoTool.join_pheno_df_with_variants(pheno_df, variants)
예제 #3
0
def test_init_empty_person_ids(fake_phenotype_data):
    pheno_tool = PhenoTool(fake_phenotype_data, "i1.m1", person_ids=[])
    assert pheno_tool
예제 #4
0
def test_get_normalize_measure_id_measure_dict_no_keys(fake_phenotype_data):
    pheno_tool = PhenoTool(fake_phenotype_data, "i1.m1")
    with pytest.raises(AssertionError):
        pheno_tool._get_normalize_measure_id({"measure_name": "something"})
    with pytest.raises(AssertionError):
        pheno_tool._get_normalize_measure_id({"instrument_name": "something"})