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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
plotID
plotID_matlab
Commits
a78ff0e0
Commit
a78ff0e0
authored
3 years ago
by
Lemmer, Jan
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
#48
remove ID as input from publsish add UserInput in case of missing ID
parent
0bea01b9
No related branches found
No related tags found
1 merge request
!21
Fixes #48
Pipeline
#573255
passed
3 years ago
Stage: Run
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
+PlotID/Publish.m
+16
-2
16 additions, 2 deletions
+PlotID/Publish.m
CI_files/default_test.m
+1
-1
1 addition, 1 deletion
CI_files/default_test.m
example.m
+3
-3
3 additions, 3 deletions
example.m
with
20 additions
and
6 deletions
+PlotID/Publish.m
+
16
−
2
View file @
a78ff0e0
function
Publish
(
DataPaths
,
scriptPath
,
ID
,
figure
,
options
)
function
Publish
(
DataPaths
,
scriptPath
,
figure
,
options
)
%%Publish(DataPaths,scriptPath, ID, figure, options) saves plot, data and measuring script
%
% DataPaths contains the path(s) to the research data, for multiple files
...
...
@@ -20,7 +20,6 @@ function Publish(DataPaths,scriptPath, ID, figure, options)
arguments
DataPaths
{
mustBeDataPath
}
% location of the data-file(s)
scriptPath
(
1
,:)
{
mustBeFile
}
% location of the matlab script
ID
(
1
,:)
{
mustBeNonzeroLengthText
}
% ID must be provided
figure
(
1
,:)
{
mustBeFigure
}
% Checks if figure is a figure object
options
.
Location
{
mustBeMember
(
options
.
Location
,{
'local'
,
'server'
,
'manual'
,
'CI-Test'
})}
=
'local'
% storage path
options
.
Method
{
mustBeMember
(
options
.
Method
,{
'individual'
,
'centralized'
})}
=
'individual'
...
...
@@ -29,6 +28,7 @@ arguments
options
.
CSV
(
1
,
1
)
{
mustBeNumericOrLogical
}
=
false
end
%% argument validation
%catch multiple figures in fig
if
numel
(
figure
)
>
1
figure
=
figure
(
1
);
...
...
@@ -38,6 +38,20 @@ if numel(figure) > 1
warning
(
msg
);
end
%get ID from Figure
ID
=
figure
.
Tag
;
if
isempty
(
ID
)
% no ID found, User dialog for Folder name
ID
=
inputdlg
([
'No ID defined- '
newline
,
...
'Please enter a folder name to continue:'
],
'Please enter a folder name'
);
ID
=
ID
{
1
};
msg
=
[
'No ID found - consider to use the TagPlot function before '
,
...
'you publish '
,
newline
,
'your files will be stored in '
,
ID
];
warning
(
msg
);
end
%% read config file
try
txt
=
fileread
(
'config.json'
);
...
...
This diff is collapsed.
Click to expand it.
CI_files/default_test.m
+
1
−
1
View file @
a78ff0e0
...
...
@@ -56,7 +56,7 @@ try
% file name of the data
rdata
=
{
dataset1
,
dataset2
}
;
% don't forget the extension
PlotID
.
Publish
(
rdata
,
script
,
ID
,
figs
,
'Location'
,
'CI-Test'
)
PlotID
.
Publish
(
rdata
,
script
,
figs
,
'Location'
,
'CI-Test'
)
result
=
true
;
% clean up
...
...
This diff is collapsed.
Click to expand it.
example.m
+
3
−
3
View file @
a78ff0e0
...
...
@@ -78,7 +78,7 @@ locations = {dataset1,dataset2} ; % don't forget the extension
%locations = {'test_data.mat', 'falsch'};
%call publishing
PlotID
.
Publish
(
locations
,
scriptPath
,
ID
,
fig
(
1
),
'Location'
,
'local'
,
'Method'
,
'individual'
)
PlotID
.
Publish
(
locations
,
scriptPath
,
fig
(
1
),
'Location'
,
'local'
,
'Method'
,
'individual'
)
%% Example 2: multiple plots plot, all based on dataset2 (hdf5)
% for individual data-sets, use an appropriate array
...
...
@@ -99,7 +99,7 @@ rdata = dataset2 ; % don't forget the extension
% publsihing via a for-loop
for
i
=
1
:
numel
(
fig
)
PlotID
.
Publish
(
rdata
,
script
,
IDs
{
i
},
fig
(
i
),
'Location'
,
'local'
,
...
PlotID
.
Publish
(
rdata
,
script
,
fig
(
i
),
'Location'
,
'local'
,
...
'Method'
,
'individual'
);
end
...
...
@@ -117,4 +117,4 @@ plot(x1,y1,'-r');
[
fig2
,
ID
]
=
PlotID
.
TagPlot
(
fig2
,
'ProjectID'
,
ProjectID
);
PlotID
.
Publish
(
locations
,
scriptPath
,
ID
,
fig2
,
'Location'
,
'local'
,
'Method'
,
'centralized'
)
PlotID
.
Publish
(
locations
,
scriptPath
,
fig2
,
'Location'
,
'local'
,
'Method'
,
'centralized'
)
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