Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
788b1d4f
Commit
788b1d4f
authored
2 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Config: disentangle changes to config and final evaluation in expconfig
parent
1bfa0cd5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
expconfig.py
+17
-16
17 additions, 16 deletions
expconfig.py
with
17 additions
and
16 deletions
expconfig.py
+
17
−
16
View file @
788b1d4f
...
...
@@ -543,19 +543,6 @@ class ExpConfig(ConfigObj):
if
not
getexp
:
pre_config
[
'
VERSIONS_
'
]
=
config_versions
# Re-read merged config with interpolation set.
# This works around incomprehensible inheritance of interpolation with
# merge. Make sure that all values are interpolated
config_lines
=
io
.
BytesIO
()
pre_config
.
write
(
config_lines
)
pre_config
=
None
config_lines
.
seek
(
0
)
pre_config
=
ConfigObj
(
io
.
TextIOWrapper
(
config_lines
),
interpolation
=
False
if
getexp
else
'
template
'
)
# Extract experiment description from initial comment
# if not set explicitly
if
'
EXP_DESCRIPTION
'
not
in
pre_config
:
...
...
@@ -574,6 +561,23 @@ class ExpConfig(ConfigObj):
))
)
# Additional experiment info
self
.
experiment_id
=
pre_config
[
ExpConfig
.
id_name
]
self
.
experiment_kind
=
re
.
sub
(
r
'
-\w+$
'
,
''
,
experiment_type
)
# Re-read merged config with interpolation set.
# This works around incomprehensible inheritance of interpolation with
# merge. Make sure that all values are interpolated
config_lines
=
io
.
BytesIO
()
pre_config
.
write
(
config_lines
)
pre_config
=
None
config_lines
.
seek
(
0
)
pre_config
=
ConfigObj
(
io
.
TextIOWrapper
(
config_lines
),
interpolation
=
False
if
getexp
else
'
template
'
)
pre_config
.
walk
(
eval_key
)
# Re-read final config without interpolation.
...
...
@@ -588,7 +592,4 @@ class ExpConfig(ConfigObj):
ConfigObj
.
__init__
(
self
,
io
.
TextIOWrapper
(
config_lines
),
interpolation
=
False
)
self
.
walk
(
uneval_key
)
self
.
experiment_id
=
self
[
ExpConfig
.
id_name
]
self
.
experiment_kind
=
re
.
sub
(
r
'
-\w+$
'
,
''
,
experiment_type
)
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