Skip to content

Commit

Permalink
add provenance note to function in base
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmarx committed May 27, 2019
1 parent b10863d commit 1248546
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 3 deletions.
5 changes: 5 additions & 0 deletions test/base/clearGlobal.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ function clearGlobal(globalName)
%
% INPUTS:
% globalName: The name of the global variable to clear.
%
% NOTE:
% this function has been uploaded from
% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/clearGlobal.m
% [e6b4efd]

clearvars('-global',globalName);
end
6 changes: 6 additions & 0 deletions test/base/getEnvironment.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
% environment: a struct with two fields
% * .globals - contains all global values
% * .path - contains the current path
%
% NOTE:
% this function has been uploaded from
% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/getEnvironment.m
% [cadfa58]

environment = struct();
globals = struct();
globalvars = who('global');
Expand Down
6 changes: 6 additions & 0 deletions test/base/getFilesInDir.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
%
% % get only the gitIgnored files in the current folder
% files = getFilesInDir('type', 'ignored');
%
% NOTE:
% this function has been uploaded from
% https://github.com/opencobra/cobratoolbox/blob/master/src/base/install/getFilesInDir.m
% [cdb2478]


persistent COBRAIgnored

Expand Down
6 changes: 6 additions & 0 deletions test/base/getGlobalValue.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
%
% OUTPUT:
% value: The value of the requested global variable
%
% NOTE:
% this function has been uploaded from
% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/getGlobalValue.m
% [e6b4efd]


eval(['global ' globalName]);
eval(['value = ' globalName ';']);
Expand Down
8 changes: 7 additions & 1 deletion test/base/getIgnoredFiles.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
% ignoredFiles: All files (and patterns) indicated as ignored in
% the gitignore file.
%
% .. Authors: - Original Code: Laurent Heirandt
% .. Authors: - Original Code: Laurent Heirendt
% - Move to function: Thomas Pfau, Jan 2018
%
% NOTE:
% this function has been adapted from
% https://github.com/opencobra/cobratoolbox/blob/master/src/base/install/getIgnoredFiles.m
% [f9a9213]



global CELLFIEDIR
Expand Down
7 changes: 6 additions & 1 deletion test/base/restoreEnvironment.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ function restoreEnvironment(environment, restorePath, printLevel)
% printLevel: Set the verbosity of this method:
% * 0: No outputs (Default)
% * 1: Info what each value is set to
%
%
% NOTE:
% this function has been adapted from
% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/restoreEnvironment.m
% [005f7d1]

if ~exist('restorePath','var')
restorePath = true;
end
Expand Down
6 changes: 6 additions & 0 deletions test/base/runScriptFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
% - `.Error`: Error message received from a failed or skipped test
%
% .. Author: - Thomas Pfau Jan 2018.
%
% NOTE:
% this function has been adapted from
% https://github.com/opencobra/cobratoolbox/blob/master/test/runScriptFile.m
% [b58da0c]


global CBT_MISSING_REQUIREMENTS_ERROR_ID

Expand Down
6 changes: 6 additions & 0 deletions test/base/runTestSuite.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
%
% Author:
% - Thomas Pfau Jan 2018.
%
% NOTE:
% this function has been adapted from
% https://github.com/opencobra/cobratoolbox/blob/master/test/runTestSuite.m
% [5395578]


global CELLFIEDIR

Expand Down
8 changes: 7 additions & 1 deletion test/base/setGlobal.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ function setGlobal(globalName,globalValue)
%
% INPUTS:
% globalName: A string representing the name of the global variable
% globalValue: The value to set the global variable to
% globalValue: The value to set the global variable
%
% NOTE:
% this function has been adapted from
% https://github.com/opencobra/cobratoolbox/blob/master/src/base/utilities/setGlobal.m
% [e6b4efd]


eval([ globalName '_val = globalValue;']);
eval(['global ' globalName]);
Expand Down

0 comments on commit 1248546

Please sign in to comment.