Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
plotID_matlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plotID
plotID_matlab
Commits
6cd717fd
Commit
6cd717fd
authored
3 years ago
by
Lemmer, Jan
Browse files
Options
Downloads
Plain Diff
Merge branch '96-analyse-der-verwendeten-funktionen-matlab-packages' into 'development'
Implements
#96
See merge request
!55
parents
43a23c29
314302a3
Branches
Branches containing commit
No related tags found
2 merge requests
!62
Introduce changes for V1.0 RC 1
,
!55
Implements #96
Pipeline
#652635
passed
3 years ago
Stage: Run
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
+PlotID/Publish.m
+2
-8
2 additions, 8 deletions
+PlotID/Publish.m
+PlotID/copyUserFCN.m
+60
-0
60 additions, 0 deletions
+PlotID/copyUserFCN.m
+PlotID/createFileCopy.m
+2
-0
2 additions, 0 deletions
+PlotID/createFileCopy.m
+PlotID/removePltIdFiles.m
+0
-27
0 additions, 27 deletions
+PlotID/removePltIdFiles.m
with
64 additions
and
35 deletions
+PlotID/Publish.m
+
2
−
8
View file @
6cd717fd
...
...
@@ -161,13 +161,7 @@ dlgObj.userMSG(msg);
% user functions
if
options
.
CopyUserFCN
[
fList
,
pList
]
=
matlab
.
codetools
.
requiredFilesAndProducts
(
scriptPath
);
fList
=
fList
(
~
ismember
(
fList
,
scriptPath
));
% rmv script from list
fList
=
fList
(
~
contains
(
fList
,
'config.json'
));
% rmv config.json from list
fList
=
PlotID
.
removePltIdFiles
(
fList
);
% Do not copy files that are part of PlotID
if
~
isempty
(
fList
)
PlotID
.
createFileCopy
(
fList
,
folderName
,
storPath
,
ID
,
'userFcn'
);
end
toolboxList
=
PlotID
.
copyUserFCN
(
scriptPath
,
folderName
,
storPath
,
ID
);
end
%% Research data handling
...
...
@@ -239,7 +233,7 @@ meta.ProjectID = ID;
meta
.
CreationDate
=
datestr
(
now
);
meta
.
MatlabVersion
=
version
;
if
options
.
CopyUserFCN
meta
.
ToolboxVersions
=
p
List
;
meta
.
ToolboxVersions
=
toolbox
List
;
end
% write meta
metaPath
=
fullfile
(
storPath
,
folderName
,
'plotID_data.json'
);
...
...
This diff is collapsed.
Click to expand it.
+PlotID/copyUserFCN.m
0 → 100644
+
60
−
0
View file @
6cd717fd
function
pList
=
copyUserFCN
(
scriptPath
,
folderName
,
storPath
,
ID
)
%COPYUSERFCN copies all user functions, classes and toolboxes that are used
%by the base script (scriptpath).
% folderName, storPath and ID are required for createfilecopy
[
fList
,
pList
]
=
matlab
.
codetools
.
requiredFilesAndProducts
(
scriptPath
);
fList
=
fList
(
~
ismember
(
fList
,
scriptPath
));
% rmv plot script itself from list
fList
=
fList
(
~
contains
(
fList
,
'config.json'
));
% rmv config.json from list
fList
=
removePltIdFiles
(
fList
);
% Do not copy files that are part of PlotID
% copy Classes and Toolboxes as a whole
copyTBorClass
(
fList
,
'+'
,
folderName
,
storPath
,
ID
);
% Toolboxes
copyTBorClass
(
fList
,
'@'
,
folderName
,
storPath
,
ID
);
% Classes
%remove class and toolbox files from flist
fList
=
fList
(
~
contains
(
fList
,{
'@'
,
'+'
}));
% copy User FCN
if
~
isempty
(
fList
)
PlotID
.
createFileCopy
(
fList
,
folderName
,
storPath
,
ID
,
'userFcn'
);
end
end
function
[
fListClean
]
=
removePltIdFiles
(
fList
)
%removePltIdFiles removes functions that are part of PlotID out of flist
% Detailed explanation goes here
[
~
,
names
,
ext
]
=
fileparts
(
fList
);
names
=
strcat
(
names
,
ext
);
% add ext for comparison
% Get a list of all .m files that are part of Plot id
packageContent
=
what
(
'PlotID'
);
% packageContent.classes has no extensions
PltID_classlist
=
packageContent
.
classes
;
% Class Methods need to be listed in an additional function
Class_flist
=
cell
(
1
,
numel
(
packageContent
.
classes
));
%preallocate
for
i
=
1
:
numel
(
packageContent
.
classes
)
temp
=
what
([
'PlotID'
,
filesep
,
'@'
,
PltID_classlist
{
i
}]);
Class_flist
{
i
}
=
temp
.
m
;
end
Class_flist
=
vertcat
(
Class_flist
{:});
% all plotID .m files:
PltID_flist
=
[
packageContent
.
m
;
Class_flist
];
% Comparison and filter
fListClean
=
fList
(
~
ismember
(
names
,
PltID_flist
));
end
function
[
status
,
msg
]
=
copyTBorClass
(
fList
,
leadChar
,
folderName
,
storPath
,
ID
)
%copyTBorClass copies the Toolboxes or Classes that are part of flist
% lead char must be either '@' for Classes or '+' for Toolboxes
if
any
(
contains
(
fList
,
leadChar
))
list
=
fList
(
contains
(
fList
,
leadChar
));
names
=
extractBetween
(
list
,
leadChar
,
filesep
);
paths
=
extractBefore
(
list
,
strcat
(
leadChar
,
names
));
fullPaths
=
strcat
(
paths
,
strcat
(
leadChar
,
names
));
fullPaths
=
unique
(
fullPaths
);
[
~
,
status
,
msg
]
=
PlotID
.
createFileCopy
(
fullPaths
,
...
folderName
,
storPath
,
ID
,
'class'
);
end
%if
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
+PlotID/createFileCopy.m
+
2
−
0
View file @
6cd717fd
...
...
@@ -29,6 +29,8 @@ end
case
'userFcn'
%keep original name
newfile
=
sprintf
([
name
,
ext
]);
case
{
'class'
,
'toolbox'
}
newfile
=
name
;
% copy whole folder
otherwise
error
([
type
,
' is not a valid type for createFileCopy'
])
end
%switch
...
...
This diff is collapsed.
Click to expand it.
+PlotID/removePltIdFiles.m
deleted
100644 → 0
+
0
−
27
View file @
43a23c29
function
[
fListClean
]
=
removePltIdFiles
(
fList
)
%removePltIdFiles removes functions that are part of PlotID out of flist
% Detailed explanation goes here
[
~
,
names
,
ext
]
=
fileparts
(
fList
);
names
=
strcat
(
names
,
ext
);
% add ext for comparison
% Get a list of all .m files that are part of Plot id
packageContent
=
what
(
'PlotID'
);
% packageContent.classes has no extensions
PltID_classlist
=
packageContent
.
classes
;
% Class Methods need to be listed in an additional function
Class_flist
=
cell
(
1
,
numel
(
packageContent
.
classes
));
%preallocate
for
i
=
1
:
numel
(
packageContent
.
classes
)
temp
=
what
([
'PlotID'
,
filesep
,
'@'
,
PltID_classlist
{
i
}]);
Class_flist
{
i
}
=
temp
.
m
;
end
Class_flist
=
vertcat
(
Class_flist
{:});
% all plotID .m files:
PltID_flist
=
[
packageContent
.
m
;
Class_flist
];
% Comparison and filter
fListClean
=
fList
(
~
ismember
(
names
,
PltID_flist
));
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment