Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
exp-runner
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Christopher Spinrath
exp-runner
Commits
5d4e5248
Commit
5d4e5248
authored
1 month ago
by
Christopher Spinrath
Browse files
Options
Downloads
Patches
Plain Diff
Support variable substitutions in variable definitions
parent
6bd00067
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
run-exp.py
+17
-4
17 additions, 4 deletions
run-exp.py
with
17 additions
and
4 deletions
run-exp.py
+
17
−
4
View file @
5d4e5248
...
@@ -241,11 +241,24 @@ def main(config_file, global_timeout, dry_run):
...
@@ -241,11 +241,24 @@ def main(config_file, global_timeout, dry_run):
print
(
f
"
> and
{
c
.
repetitions
}
repetitions
"
)
print
(
f
"
> and
{
c
.
repetitions
}
repetitions
"
)
print
()
print
()
variable_map
=
{
v
.
name
:
v
.
evaluate
({})
for
v
in
c
.
varia
ble
s
}
# we precompute all variable values to be able to abort early in case of a pro
ble
m,
value_combinations
=
itertools
.
product
(
*
variable_map
.
values
())
# for instance, if a file does not exist
run_values
=
[
dict
(
zip
(
variable_map
.
keys
(),
vals
))
for
vals
in
value_combinations
]
variable_maps
=
[{}
]
for
variables
in
run_values
:
for
variable
in
c
.
variables
:
updated_variable_maps
=
[]
for
variable_map
in
variable_maps
:
values
=
variable
.
evaluate
(
variable_map
)
for
value
in
values
:
updated_map
=
variable_map
.
copy
()
updated_map
[
variable
.
name
]
=
value
updated_variable_maps
.
append
(
updated_map
)
variable_maps
=
updated_variable_maps
for
variables
in
variable_maps
:
print
()
print
()
print
(
"
Running tasks with variable map:
"
)
print
(
"
Running tasks with variable map:
"
)
print
(
variables
)
print
(
variables
)
...
...
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