Skip to content
Snippets Groups Projects
Commit 806075f6 authored by Andi Gerken's avatar Andi Gerken
Browse files

Fixed minibug

parent a634650c
No related branches found
No related tags found
1 merge request!44Added robofish-io-fix-switches
...@@ -90,7 +90,6 @@ def handle_switches(poses, supress=None): ...@@ -90,7 +90,6 @@ def handle_switches(poses, supress=None):
poses[t - 1] = np.nan poses[t - 1] = np.nan
if supress is None or t not in supress: if supress is None or t not in supress:
distances = get_distances(poses[t], last_poses) distances = get_distances(poses[t], last_poses)
switches = {} switches = {}
...@@ -101,7 +100,6 @@ def handle_switches(poses, supress=None): ...@@ -101,7 +100,6 @@ def handle_switches(poses, supress=None):
if len(switches) > 0 or np.any( if len(switches) > 0 or np.any(
np.isnan(poses[t]) != np.isnan(poses[t - 1]) np.isnan(poses[t]) != np.isnan(poses[t - 1])
): ):
switch_distances = np.array( switch_distances = np.array(
[ [
get_distances(poses[t, con_perm], last_poses, diagonal=True) get_distances(poses[t, con_perm], last_poses, diagonal=True)
...@@ -124,7 +122,6 @@ def handle_switches(poses, supress=None): ...@@ -124,7 +122,6 @@ def handle_switches(poses, supress=None):
if np.argmin(switch_distances_sum) != 0: if np.argmin(switch_distances_sum) != 0:
if distances_switched * 1.5 < distances_normal: if distances_switched * 1.5 < distances_normal:
print( print(
f"Switch: {connections} distance sum\t{np.min(switch_distances_sum):.2f} vs\t{np.min(switch_distances_sum[0]):.2f}" f"Switch: {connections} distance sum\t{np.min(switch_distances_sum):.2f} vs\t{np.min(switch_distances_sum[0]):.2f}"
) )
...@@ -147,7 +144,6 @@ def handle_file(file, args): ...@@ -147,7 +144,6 @@ def handle_file(file, args):
if args.columns_per_entity is None: if args.columns_per_entity is None:
all_col_types_matching = [] all_col_types_matching = []
for cols in range(1, len(pf.columns) // 2 + 1): for cols in range(1, len(pf.columns) // 2 + 1):
dt = np.array(pf.dtypes, dtype=str) dt = np.array(pf.dtypes, dtype=str)
# print(dt) # print(dt)
...@@ -262,8 +258,6 @@ def handle_file(file, args): ...@@ -262,8 +258,6 @@ def handle_file(file, args):
if all_switches is not None: if all_switches is not None:
iof.attrs["switches"] = all_switches iof.attrs["switches"] = all_switches
iof.attrs["switches"] = all_switches
# assert np.all( # assert np.all(
# poses[np.logical_not(np.isnan(poses[:, 0])), 0] >= 0 # poses[np.logical_not(np.isnan(poses[:, 0])), 0] >= 0
# ), f"Error: x coordinate is not positive, {np.min(poses[:, 0])}" # ), f"Error: x coordinate is not positive, {np.min(poses[:, 0])}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment