def test_plot(): histo_full = KVH_file("test_all_print.hdf") histo_full.draw_history() histo1 = KVH_file("test_data123.hdf") histo1.draw_history( keys=[x for x in histo1.dico.keys() if x != "computing images"]) histo1.draw_pie(keys=[x for x in histo1.dico.keys() if x != "computing images"]) histo2 = KVH_file("one_it.hdf") histo2.draw_history() histo2.draw_bars() histo2.plot(block=False) histo3 = KVH_file("test_empty.hdf") histo3.draw_history() histo3.draw_bars(it=1) histo3.draw_pie(it=1) histo3.plot(block=False)
def test_equilibrate(): histo3 = KVH_file("not_equilibred.hdf") max_key, max_len = histo3.get_max_len() assert max_key == 'key2' assert max_len == 3 histo3.draw_history(title='tata_tutu') histo3.re_equilibrate(['key2'], max_len) histo3.re_equilibrate(['key'], max_len, left=True) histo3.re_equilibrate(['key3'], max_len, left=False) assert histo3.dico['key'].means == [None, 1, 2] assert histo3.dico['key2'].means == [1, 2, 3] assert histo3.dico['key3'].means == [4, 5, None]