Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
why3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Why3
why3
Commits
c61605e4
Commit
c61605e4
authored
15 years ago
by
Simon Cruanes
Browse files
Options
Downloads
Patches
Plain Diff
amélioration du script de statistiques
parent
0e5d3f39
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
comparison/lib.py
+25
-0
25 additions, 0 deletions
comparison/lib.py
comparison/stats.py
+39
-0
39 additions, 0 deletions
comparison/stats.py
with
64 additions
and
0 deletions
comparison/lib.py
+
25
−
0
View file @
c61605e4
...
...
@@ -24,6 +24,24 @@ def diff(cursor, prover1, prover2):
return
[]
def
superior
(
cursor
,
prover1
,
prover2
):
"
trouve les (file,goal) pour lesquels prover1 > prover2
"
query
=
"""
SELECT distinct r1.file, r1.goal
FROM runs r1 JOIN runs r2
WHERE r1.prover =
"
%s
"
AND r2.prover =
"
%s
"
AND r1.result =
"
Valid
"
AND r2.result =
"
Timeout
"
AND r1.file = r2.file AND r1.goal = r2.goal
"""
%
(
prover1
,
prover2
)
try
:
result
=
cursor
.
execute
(
query
)
return
result
.
fetchall
()
except
Exception
,
e
:
print
>>
sys
.
stderr
,
"
exception :
"
,
repr
(
e
)
return
None
def
print_columns
(
lines
,
sep
=
"
.
"
):
...
...
@@ -47,3 +65,10 @@ def print_columns(lines, sep = "."):
def
print_sep
():
"
affiche une ligne de
'
-
'
pour séparer clairement des sections de l
'
affichage
"
print
"
---------------------------------------------------------------
"
def
erase_line
(
stream
=
sys
.
stdout
):
"
efface la ligne et revient au début
"
stream
.
write
(
"
\033
[2K
\r
"
)
stream
.
flush
()
This diff is collapsed.
Click to expand it.
comparison/stats.py
+
39
−
0
View file @
c61605e4
...
...
@@ -57,3 +57,42 @@ for prover in provers:
table
.
append
(
entry
)
lib
.
print_columns
(
table
,
sep
=
"
"
)
# trouver quels prouveurs sont supérieurs les uns aux autres
lib
.
print_sep
()
order
=
{}
for
p1
,
p2
in
[(
p1
,
p2
)
for
p1
in
provers
for
p2
in
provers
if
p1
!=
p2
]:
print
"
compare
"
,
p1
,
p2
,
sys
.
stdout
.
flush
()
sups
=
lib
.
superior
(
cursor
,
p1
,
p2
)
# effacer la ligne
lib
.
erase_line
()
order
[
(
p1
,
p2
)
]
=
len
(
sups
)
print
"
\n
"
# affiche l'ordre partiel
table
=
[
[
"
prouveur1
"
,
"
>
"
,
"
prouveur2
"
,
"
de
"
,
"
nombre de tasks
"
]
]
for
((
p1
,
p2
),
num
)
in
order
.
iteritems
():
table
.
append
(
[
p1
,
""
,
p2
,
""
,
unicode
(
num
)]
)
def
getKey
(
x
):
try
:
return
int
(
x
[
4
])
except
:
return
0
table
.
sort
(
key
=
getKey
)
lib
.
print_columns
(
table
,
sep
=
"
"
)
# TODO : afficher un tableau
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