def test_model_round(): mr = ModelRound(previous_stmts, '2020-01-01-00-00-00', previous_papers) assert mr assert mr.get_total_statements() == 2 assert len(mr.get_stmt_hashes()) == 2 assert mr.get_statement_types() == [('Activation', 2)] assert all(agent_tuple in mr.get_agent_distribution() for agent_tuple in [('BRAF', 1), ('MAP2K1', 2), ('MAPK1', 1)]) assert all((stmt_hash, 1) in mr.get_statements_by_evidence() for stmt_hash in mr.get_stmt_hashes()) assert mr.get_sources_distribution() == [('assertion', 2)] assert mr.get_number_raw_papers() == 1, mr.get_number_raw_papers() assert mr.get_number_assembled_papers() == 1 mr2 = ModelRound(new_stmts, '2020-01-02-00-00-00', new_papers) assert mr2 assert mr2.get_total_statements() == 4 assert len(mr2.get_stmt_hashes()) == 4 assert mr2.get_statement_types() == [('Activation', 4)] assert all(agent_tuple in mr2.get_agent_distribution() for agent_tuple in [('BRAF', 2), ('MAP2K1', 2), ('MAPK1', 1), ('MTOR', 1), ('AKT', 2)]) assert len(mr2.find_delta_hashes(mr, 'statements')['added']) == 2 assert all(source_tuple in mr2.get_sources_distribution() for source_tuple in [('assertion', 2), ('test_source1', 1), ('test_source2', 1)]) assert mr2.get_number_raw_papers() == 3 assert set(mr2.find_delta_hashes(mr, 'raw_papers')['added']) == { '2345', '3456'} assert mr2.get_number_assembled_papers() == 2, mr2.stmts_by_papers assert set(mr2.find_delta_hashes(mr, 'assembled_papers')['added']) == { '2345'}
def test_model_round(): mr = ModelRound(previous_stmts, '2020-01-01-00-00-00') assert mr assert mr.get_total_statements() == 2 assert len(mr.get_stmt_hashes()) == 2 assert mr.get_statement_types() == [('Activation', 2)] assert all(agent_tuple in mr.get_agent_distribution() for agent_tuple in [('BRAF', 1), ('MAP2K1', 2), ('MAPK1', 1)]) assert all((stmt_hash, 1) in mr.get_statements_by_evidence() for stmt_hash in mr.get_stmt_hashes()) assert mr.get_sources_distribution() == [('assertion', 2)] mr2 = ModelRound(new_stmts, '2020-01-02-00-00-00') assert mr2 assert mr2.get_total_statements() == 4 assert len(mr2.get_stmt_hashes()) == 4 assert mr2.get_statement_types() == [('Activation', 4)] assert all(agent_tuple in mr2.get_agent_distribution() for agent_tuple in [('BRAF', 2), ('MAP2K1', 2), ('MAPK1', 1), ('MTOR', 1), ('AKT', 2)]) assert len(mr2.find_delta_hashes(mr, 'statements')['added']) == 2 assert all(source_tuple in mr2.get_sources_distribution() for source_tuple in [('assertion', 2), ('test_source1', 1), ('test_source2', 1)])