diff --git a/examples/timingWithLevelDataCollection.m b/examples/timingWithLevelDataCollection.m index ad36a75950a1d1099ad1442446b595734281ada8..720e65e52a421384ed721ef1889de8db12a39fe0 100644 --- a/examples/timingWithLevelDataCollection.m +++ b/examples/timingWithLevelDataCollection.m @@ -7,8 +7,9 @@ nRuns = 10; %% run time measurements +storeResults = false; leveldatacollection = ... - TimeIt('debugTiming', nRuns, 'storingLevelOrientedData', false, false); + TimeIt('debugTiming', nRuns, storeResults, 'storingLevelOrientedData', false, false); %% print statistical analysis of timing results leveldatacollection.printStatistics(); @@ -18,4 +19,4 @@ figure(); leveldatacollection.plotStatistics('ndof'); %% save results to comma-separated file -leveldatacollection.saveToTable(); +% leveldatacollection.saveToTable(); diff --git a/lib/storage/@LevelData/LevelData.m b/lib/storage/@LevelData/LevelData.m index 662bf4bba40879e136f1cf7a2e54613dc4197220..5b4955d15d2da5300edffc333fa6568f8d35ca78 100644 --- a/lib/storage/@LevelData/LevelData.m +++ b/lib/storage/@LevelData/LevelData.m @@ -90,7 +90,6 @@ classdef LevelData < handle & matlab.mixin.CustomDisplay obj.category = dictionary(); - ensureFolderExists(obj.root); % Initialise dictionary with some default values obj.dictionary = getDefaultDictionary(); end diff --git a/lib/storage/@LevelData/plotLevel.m b/lib/storage/@LevelData/plotLevel.m index 5db71169cc8b31672f1c0a17603e4cdc1c707730..455d8290b990e4e7597c84b78ffebf60232c673a 100644 --- a/lib/storage/@LevelData/plotLevel.m +++ b/lib/storage/@LevelData/plotLevel.m @@ -25,13 +25,13 @@ function ax = plotLevel(obj, category, xVariable, yVariable) obj category DataCategory xVariable {mustBeTextScalar} - yVariable cell + yVariable (1,:) cell end % Extract variables with correct category, type, and shape for y-axis idx = (obj.category(yVariable) == category) ... - & ([obj.type(yVariable).rawType]' == RawType.FLOAT) ... - & [obj.type(yVariable).isScalar]'; + & ([obj.type(yVariable).rawType] == RawType.FLOAT) ... + & [obj.type(yVariable).isScalar]; yVariable = yVariable(idx); % Create handle to currently active axis object diff --git a/lib/storage/@LevelDataCollection/LevelDataCollection.m b/lib/storage/@LevelDataCollection/LevelDataCollection.m index 6cc2e4fbda18217305dda9439aef05888a446da4..bf886751ea8dee3113f5e910143440ba1514010c 100644 --- a/lib/storage/@LevelDataCollection/LevelDataCollection.m +++ b/lib/storage/@LevelDataCollection/LevelDataCollection.m @@ -57,7 +57,6 @@ classdef LevelDataCollection < handle if nargin >= 1 obj.root = rootpath; end - ensureFolderExists(obj.root); obj.metaData = dictionary(... "problem", "problem", ... diff --git a/lib/storage/TimeIt.m b/lib/storage/TimeIt.m index b43784341a4288b373a7086cab791b27dab011d6..dfc7b06e12aff8d96cb7c38535242a70f3378a3d 100644 --- a/lib/storage/TimeIt.m +++ b/lib/storage/TimeIt.m @@ -1,4 +1,4 @@ -function leveldatacollection = TimeIt(identifier, nRun, functionName, arguments) +function leveldatacollection = TimeIt(identifier, nRun, storeResults, functionName, arguments) %%TIMEIT function wrapper for multiple runs of functions storing timing %data in LevelData objects % leveldatacollection = TIMEIT(identifier, nRun, functionName, arguments, ...) @@ -20,9 +20,10 @@ function leveldatacollection = TimeIt(identifier, nRun, functionName, arguments) % arguments - identifier - nRun - functionName + identifier {mustBeTextScalar} + nRun (1,1) double + storeResults (1,1) logical + functionName {mustBeTextScalar} end arguments (Repeating) @@ -49,8 +50,10 @@ function leveldatacollection = TimeIt(identifier, nRun, functionName, arguments) leveldata.removeNonscalar(); % Store information leveldatacollection.append(leveldata); - % Save intermediate collection to file - leveldatacollection.saveToFile(); + if storeResults + % Save intermediate collection to file + leveldatacollection.saveToFile(); + end % Print information on current run leveldatacollection.printItem(); end