From 1cbf97c0ff7005370450a9fbe1e6893f67da40dd Mon Sep 17 00:00:00 2001 From: Sherry Date: Tue, 14 Dec 2021 20:27:00 -0500 Subject: [PATCH 1/3] feat: ensure true_depth is added to result_00.yaml --- moseq2_extract/helpers/wrappers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moseq2_extract/helpers/wrappers.py b/moseq2_extract/helpers/wrappers.py index ef4adc7..f5f4bd8 100644 --- a/moseq2_extract/helpers/wrappers.py +++ b/moseq2_extract/helpers/wrappers.py @@ -396,6 +396,8 @@ def extract_wrapper(input_file, output_dir, config_data, num_frames=None, skip=F print(e) status_dict['complete'] = True + if status_dict['parameters'].get('true_depth') is None: + status_dict['parameters']['true_depth'] = int(config_data.get('true_depth')) with open(status_filename, 'w') as f: yaml.safe_dump(status_dict, f) From 3a2233da91b2fde8a0ccafe2f51a4bad9e682645 Mon Sep 17 00:00:00 2001 From: Sherry Date: Tue, 28 Dec 2021 15:55:08 -0500 Subject: [PATCH 2/3] chore: true_depth not cast to int --- moseq2_extract/helpers/wrappers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moseq2_extract/helpers/wrappers.py b/moseq2_extract/helpers/wrappers.py index f5f4bd8..8ec3ffc 100644 --- a/moseq2_extract/helpers/wrappers.py +++ b/moseq2_extract/helpers/wrappers.py @@ -397,7 +397,7 @@ def extract_wrapper(input_file, output_dir, config_data, num_frames=None, skip=F status_dict['complete'] = True if status_dict['parameters'].get('true_depth') is None: - status_dict['parameters']['true_depth'] = int(config_data.get('true_depth')) + status_dict['parameters']['true_depth'] = config_data.get('true_depth') with open(status_filename, 'w') as f: yaml.safe_dump(status_dict, f) From 3f7c582fe4df63df03e00add2dd16e0d0b3dfa22 Mon Sep 17 00:00:00 2001 From: Sherry Date: Wed, 29 Dec 2021 19:53:38 -0500 Subject: [PATCH 3/3] fix: config_data['true_depth'] cast to float --- moseq2_extract/helpers/wrappers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moseq2_extract/helpers/wrappers.py b/moseq2_extract/helpers/wrappers.py index 8ec3ffc..82a8b36 100644 --- a/moseq2_extract/helpers/wrappers.py +++ b/moseq2_extract/helpers/wrappers.py @@ -397,8 +397,8 @@ def extract_wrapper(input_file, output_dir, config_data, num_frames=None, skip=F status_dict['complete'] = True if status_dict['parameters'].get('true_depth') is None: - status_dict['parameters']['true_depth'] = config_data.get('true_depth') - + # config_data.get('true_depth') is numpy.float64 and yaml.safe_dump can't represent the object + status_dict['parameters']['true_depth'] = float(config_data.get('true_depth')) with open(status_filename, 'w') as f: yaml.safe_dump(status_dict, f)