Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
schedgen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Pour rappel, le service sera inaccessible ce lundi 05/05/25 midi pour raison de mise à jour.
Show more breadcrumbs
veriT
schedgen
Commits
5c4985c4
Commit
5c4985c4
authored
3 years ago
by
Hans-Jörg
Browse files
Options
Downloads
Patches
Plain Diff
Remove old GridTPT parser
parent
813ebec6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
schedgen/opt/gridtptresult.py
+0
-81
0 additions, 81 deletions
schedgen/opt/gridtptresult.py
with
0 additions
and
81 deletions
schedgen/opt/gridtptresult.py
deleted
100644 → 0
+
0
−
81
View file @
813ebec6
import
re
import
pandas
as
pd
class
GridTPTResult
:
__type_re
=
r
"
^Type +: (\w+)$
"
__options_re
=
r
"
^Options +: (.*)$
"
__cpu_limit_re
=
r
"
^CPU limit +: ([0-9]+)s
"
__header_re
=
r
"
^Name +total_time +result
"
__data_re
=
r
"
^([^ ]+) +([-0-9\.]+) +([^ ]+)
"
def
__init__
(
self
,
path
,
logics
=
None
):
results
=
[]
if
logics
:
logics
=
list
(
map
(
lambda
s
:
s
.
strip
(),
logics
))
with
path
.
open
()
as
f
:
for
line
in
f
:
m
=
re
.
match
(
self
.
__data_re
,
line
)
if
m
:
r
=
m
.
group
(
3
).
strip
()
if
r
==
"
1
"
or
r
==
"
0
"
:
time
=
float
(
m
.
group
(
2
))
else
:
time
=
float
(
"
inf
"
)
# unsolved
if
logics
:
exp_logic
=
m
.
group
(
1
).
split
(
"
/
"
)[
0
]
if
exp_logic
in
logics
:
results
.
append
((
m
.
group
(
1
),
time
))
else
:
results
.
append
((
m
.
group
(
1
),
time
))
continue
m
=
re
.
match
(
self
.
__type_re
,
line
)
if
m
:
r
=
m
.
group
(
1
).
strip
()
if
not
r
==
"
perf
"
:
raise
ValueError
(
"
Experiment type not
'
perf
'
.
"
)
else
:
continue
m
=
re
.
match
(
self
.
__options_re
,
line
)
if
m
:
self
.
options
=
m
.
group
(
1
)
continue
m
=
re
.
match
(
self
.
__cpu_limit_re
,
line
)
if
m
:
self
.
cpu_limit
=
int
(
m
.
group
(
1
))
if
not
hasattr
(
self
,
"
cpu_limit
"
):
raise
ValueError
(
"
Could not parse cpu limit.
"
)
if
not
hasattr
(
self
,
"
options
"
):
raise
ValueError
(
"
Could not parse strategy.
"
)
r
=
[
list
(
t
)
for
t
in
zip
(
*
results
)]
if
len
(
r
)
!=
2
:
raise
ValueError
(
"
Could not get any solved benchmarks.
"
)
[
names
,
times
]
=
r
self
.
results
=
pd
.
DataFrame
(
times
,
index
=
names
,
columns
=
[
"
Time
"
])
def
remove_results
(
self
,
index
):
self
.
old_results
=
self
.
results
.
copy
()
new_idx
=
self
.
results
.
index
.
difference
(
index
)
self
.
results
=
self
.
results
.
reindex
(
new_idx
)
def
restore_results
(
self
):
self
.
results
=
self
.
old_results
def
solves_in
(
self
,
benchmark
,
time_slice
):
try
:
return
self
.
results
.
loc
[
benchmark
].
Time
<=
time_slice
except
KeyError
:
return
False
"""
Returns the indices of the time slices that solve it. Assumes
time_slices is sorted in acending order.
"""
def
solve_index
(
self
,
benchmark
,
time_slices
,
epsilon
):
try
:
time
=
self
.
results
.
loc
[
benchmark
].
Time
except
KeyError
:
return
[]
for
i
in
range
(
len
(
time_slices
)):
if
time_slices
[
i
]
>=
(
time
+
epsilon
):
return
range
(
i
,
len
(
time_slices
))
return
[]
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