From 8f3f48a342ca5bb27bfc8b0286cf03befbf48834 Mon Sep 17 00:00:00 2001 From: Alex Buts Date: Tue, 26 Oct 2021 18:37:14 +0100 Subject: [PATCH] Re pace-neutrons/Herbert#356 more descriptions according to review. --- _test/test_instrument_classes/private/check_matfile_IO.m | 5 +++++ .../utilities/classes/@serializable/serializable.m | 8 ++++++++ herbert_core/utilities/maths/equal_to_tol.m | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/_test/test_instrument_classes/private/check_matfile_IO.m b/_test/test_instrument_classes/private/check_matfile_IO.m index e0e43ea301..0d8c98d1f9 100644 --- a/_test/test_instrument_classes/private/check_matfile_IO.m +++ b/_test/test_instrument_classes/private/check_matfile_IO.m @@ -17,6 +17,11 @@ % varargin -- variables to save/load to/from file. The main part of % each filename consists of the name of these variables, % identified using Matlab function "inputname". +% Outputs: +% ok -- true if test passing and false otherwise. +% mess -- the message better identifying the reason for failure. +% Empty if ok==true +% % NOTE: % for "inputname" function work correctly, one needs to specify all % inputs as variables, e.g. calling workspace needs to have diff --git a/herbert_core/utilities/classes/@serializable/serializable.m b/herbert_core/utilities/classes/@serializable/serializable.m index 8707d81e6d..2a32eec42e 100644 --- a/herbert_core/utilities/classes/@serializable/serializable.m +++ b/herbert_core/utilities/classes/@serializable/serializable.m @@ -37,6 +37,14 @@ % method and adds more fields, responsible for identifying class, % and array information if array of objects is serialized. % + % Adds the field "version" containing result of getVersion + % function to the structure, obtained from to_bare_struct + % function. + % If converting array of objects, one can not add single value + % to the array, so function returns the structure with two fields: + % "version" and "array_dat", where array_dat contains the structure + % array, produced by "to_bare_struct" function. + % % Input: % obj -- class or array of classes object. % Returns: diff --git a/herbert_core/utilities/maths/equal_to_tol.m b/herbert_core/utilities/maths/equal_to_tol.m index 3ac1acd08a..9954f87dbb 100644 --- a/herbert_core/utilities/maths/equal_to_tol.m +++ b/herbert_core/utilities/maths/equal_to_tol.m @@ -384,7 +384,7 @@ function equal_to_tol_private(a,b,opt,name_a,name_b) end % Check fieldnames are identical - fieldsA=fieldnames(struct(a)); % gets hidden properties too + fieldsA=fieldnames(struct(a)); % gets hidden properties too fieldsB=fieldnames(struct(b)); if ~(numel(fieldsA)==numel(fieldsB)) isBinA = ismember(fieldsA,fieldsB);