From d541b89f4f8c41414f15019db936cd8bf3b11351 Mon Sep 17 00:00:00 2001 From: Constantin Pape <constantin.pape@iwr.uni-heidelberg.de> Date: Fri, 21 Jun 2019 10:20:43 +0200 Subject: [PATCH] Add test helper file --- test/attributes/compare_tables.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/attributes/compare_tables.py diff --git a/test/attributes/compare_tables.py b/test/attributes/compare_tables.py new file mode 100644 index 0000000..68be45f --- /dev/null +++ b/test/attributes/compare_tables.py @@ -0,0 +1,19 @@ +import numpy as np + + +def load_table(table_file): + table = np.genfromtxt(table_file, delimiter='\t', skip_header=1, + dtype='float32') + return table + + +# tab1 = load_table('./tmp_morpho/table_cells.csv') +# tab2 = load_table('../../data/0.0.0/tables/em-segmented-cells-labels/morphology.csv') +tab1 = load_table('./tmp_morpho/table_nuclei.csv') +tab2 = load_table('../../data/0.0.0/tables/em-segmented-nuclei-labels/morphology.csv') +print(tab1.shape) +print(tab2.shape) + +close = np.isclose(tab1, tab2) +print(close.shape) +print(close.sum(axis=0)) -- GitLab