Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
gdat
Commits
1d974e88
Commit
1d974e88
authored
2 weeks ago
by
Luke Simons
Browse files
Options
Downloads
Patches
Plain Diff
Moved functionality of getting deployment info into tcv_get_deployment_info
parent
2069eca7
No related branches found
Branches containing commit
No related tags found
1 merge request
!171
Resolve "Add tcv_get_ids_bolometer to TCV_IMAS functions"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/TCV_IMAS/tcv_get_deploymentinfo.m
+42
-37
42 additions, 37 deletions
matlab/TCV_IMAS/tcv_get_deploymentinfo.m
matlab/TCV_IMAS/tcv_get_ids_bolometer.m
+2
-5
2 additions, 5 deletions
matlab/TCV_IMAS/tcv_get_ids_bolometer.m
with
44 additions
and
42 deletions
matlab/TCV_IMAS/tcv_get_deploymentinfo.m
+
42
−
37
View file @
1d974e88
...
...
@@ -11,45 +11,50 @@ function info = tcv_get_deploymentinfo(filepath)
% Initialize output struct
info
=
struct
();
info
.
repository
=
fileparts
(
filepath
);
% Check if file exists
if
exist
(
filepath
,
'file'
)
~=
2
error
(
'File does not exist: %s'
,
filepath
);
end
% Open file for reading
fid
=
fopen
(
filepath
,
'r'
);
if
fid
==
-
1
error
(
'Could not open file: %s'
,
filepath
);
end
% Read file line by line
while
~
feof
(
fid
)
line
=
fgetl
(
fid
);
if
ischar
(
line
)
tokens
=
regexp
(
line
,
'^(\w+):\s(.+)$'
,
'tokens'
);
if
~
isempty
(
tokens
)
key
=
tokens
{
1
}{
1
};
value
=
strtrim
(
tokens
{
1
}{
2
});
% Store relevant fields in the struct
switch
key
case
'DEPLOYMENT_DATE'
info
.
deployment_date
=
value
;
case
'GIT_TAG'
info
.
git_tag
=
value
;
case
'GIT_COMMIT'
info
.
git_commit
=
value
;
case
'GIT_TAG_DATE'
info
.
git_tag_date
=
value
;
case
'GITLAB_PROJECT_URL'
info
.
gitlab_project_url
=
value
;
try
filepath
=
fullfile
(
fileparts
(
which
(
filepath
)),
'.this-deployment.info'
);
info
.
repository
=
fileparts
(
filepath
);
% Check if file exists
if
exist
(
filepath
,
'file'
)
~=
2
error
(
'File does not exist: %s'
,
filepath
);
end
% Open file for reading
fid
=
fopen
(
filepath
,
'r'
);
if
fid
==
-
1
error
(
'Could not open file: %s'
,
filepath
);
end
% Read file line by line
while
~
feof
(
fid
)
line
=
fgetl
(
fid
);
if
ischar
(
line
)
tokens
=
regexp
(
line
,
'^(\w+):\s(.+)$'
,
'tokens'
);
if
~
isempty
(
tokens
)
key
=
tokens
{
1
}{
1
};
value
=
strtrim
(
tokens
{
1
}{
2
});
% Store relevant fields in the struct
switch
key
case
'DEPLOYMENT_DATE'
info
.
deployment_date
=
value
;
case
'GIT_TAG'
info
.
git_tag
=
value
;
case
'GIT_COMMIT'
info
.
git_commit
=
value
;
case
'GIT_TAG_DATE'
info
.
git_tag_date
=
value
;
case
'GITLAB_PROJECT_URL'
info
.
gitlab_project_url
=
value
;
end
end
end
end
% Close the file
fclose
(
fid
);
catch
warning
(
'Failed to read .deployment at filepath: %s'
,
filepath
);
end
% Close the file
fclose
(
fid
);
end
This diff is collapsed.
Click to expand it.
matlab/TCV_IMAS/tcv_get_ids_bolometer.m
+
2
−
5
View file @
1d974e88
...
...
@@ -30,9 +30,7 @@ ids_bolometer_description = struct();
% Load the bolometer geometry
bolo_geom
=
bolou_load_geometry
();
bolo_geom_gitinfo
=
...
tcv_get_deploymentinfo
(
fullfile
(
fileparts
(
which
(
'bolou_load_geometry'
)),
...
'.this-deployment.info'
));
bolo_geom_gitinfo
=
tcv_get_deploymentinfo
(
'bolou_load_geometry'
);
params_eff
.
data_request
=
'\tcv_shot::top.results.bolo_u.intensity'
;
params_eff
.
trialindx
=
1
;
...
...
@@ -146,8 +144,7 @@ if status
%% Code legacy for rc_gti_prep
ids_bolometer
.
code
.
name
=
'rc_gti_prep'
;
rc_gti_prep_gitinfo
=
...
tcv_get_deploymentinfo
(
fullfile
(
fileparts
(
which
(
ids_bolometer
.
code
.
name
)),
'.this-deployment.info'
));
rc_gti_prep_gitinfo
=
tcv_get_deploymentinfo
(
ids_bolometer
.
code
.
name
);
ids_bolometer
.
code
.
description
=
...
'rc_gti_prep, RADCAM gitlab repo, calls GTI to generate emissivity profiles with liuqe.'
;
ids_bolometer
.
code
.
commit
=
rc_gti_prep_gitinfo
.
git_commit
;
...
...
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