From 4165e5e15bf244b3ddee205208e94c1ea9d11b45 Mon Sep 17 00:00:00 2001 From: Ryan Brost Date: Tue, 9 Jul 2024 09:48:17 -0600 Subject: [PATCH] test(docs): cleaning up after merge from main and updating test logs. --- .../test_instrument_driver_test_log.txt | 2 +- .../test_voltage_test_log.txt | 2 +- pyscan/general/recursive_to_dict.py | 44 ------------------- pyscan/general/recursive_to_item_attribute.py | 28 ------------ 4 files changed, 2 insertions(+), 74 deletions(-) delete mode 100644 pyscan/general/recursive_to_dict.py delete mode 100644 pyscan/general/recursive_to_item_attribute.py diff --git a/pyscan/drivers/testing/driver_test_logs/test_instrument_driver_test_log.txt b/pyscan/drivers/testing/driver_test_logs/test_instrument_driver_test_log.txt index cc01cbfe..b297b78a 100644 --- a/pyscan/drivers/testing/driver_test_logs/test_instrument_driver_test_log.txt +++ b/pyscan/drivers/testing/driver_test_logs/test_instrument_driver_test_log.txt @@ -1 +1 @@ -Passed with test_instrument_driver version v0.1.0 tested on pyscan version v0.5.3 at 2024-07-05 12:02:04 \ No newline at end of file +Passed with test_instrument_driver version v0.1.0 tested on pyscan version v0.5.4 at 2024-07-09 09:46:08 \ No newline at end of file diff --git a/pyscan/drivers/testing/driver_test_logs/test_voltage_test_log.txt b/pyscan/drivers/testing/driver_test_logs/test_voltage_test_log.txt index c62ab738..3bc7790c 100644 --- a/pyscan/drivers/testing/driver_test_logs/test_voltage_test_log.txt +++ b/pyscan/drivers/testing/driver_test_logs/test_voltage_test_log.txt @@ -1 +1 @@ -Passed with test_voltage version v0.1.0 tested on pyscan version v0.5.3 at 2024-07-05 12:02:04 \ No newline at end of file +Passed with test_voltage version v0.1.0 tested on pyscan version v0.5.4 at 2024-07-09 09:46:08 \ No newline at end of file diff --git a/pyscan/general/recursive_to_dict.py b/pyscan/general/recursive_to_dict.py deleted file mode 100644 index 72231eaa..00000000 --- a/pyscan/general/recursive_to_dict.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -import numpy as np - - -def recursive_to_dict(obj_dict): - ''' - Recursive function that converts metadata in runinfo and devices into - serializable object for saving - - Parameters - ---------- - obj_dict : :class:`~pyscan.general.itemattribute.ItemAttribute` - runinfo or devices object - ''' - new_dict = {} - - for key, value in obj_dict.items(): - # print(key, value) - # is method/function - if key in ['logger', 'expt_thread', 'data_path', - 'instrument', 'module_id_string', 'spec']: - pass - elif hasattr(value, '__call__'): - new_dict[key] = value.__name__ - elif isinstance(value, str): - new_dict[key] = value - # is a dict - elif isinstance(value, dict): - new_dict[key] = recursive_to_dict(value) - # if it is an np array - elif isinstance(value, np.ndarray): - new_dict[key] = value.tolist() - # is an iterator - elif hasattr(value, "__iter__"): - new_dict[key] = list(value) - # is an object - elif hasattr(value, "__dict__"): - new_dict[key] = recursive_to_dict(value.__dict__) - # anything else - else: - new_dict[key] = value - # maybe pass this, but test first - - return new_dict diff --git a/pyscan/general/recursive_to_item_attribute.py b/pyscan/general/recursive_to_item_attribute.py deleted file mode 100644 index 9a30aa43..00000000 --- a/pyscan/general/recursive_to_item_attribute.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -from .item_attribute import ItemAttribute - - -def recursive_to_itemattribute(data): - ''' - Recursive function that converts serialized metadata into an - ItemAttribute object - - Parameters - ---------- - data : dict - dictionary - - Returns - ------- - :class:`.ItemAttribute` - ''' - - new_data = ItemAttribute() - - for key, value in data.items(): - if isinstance(value, dict): - new_data[key] = recursive_to_itemattribute(value) - else: - new_data[key] = value - - return new_data