Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
copar-benchmarks
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Hans-Peter Deifel
copar-benchmarks
Commits
1e0e0635
Commit
1e0e0635
authored
6 years ago
by
Hans-Peter Deifel
Browse files
Options
Downloads
Patches
Plain Diff
wta: Make --different-values optional
It doesn't make much sense for powerset, so now it's possible to omit it.
parent
76705fa2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
wta/bench.py
+12
-7
12 additions, 7 deletions
wta/bench.py
with
12 additions
and
7 deletions
wta/bench.py
+
12
−
7
View file @
1e0e0635
...
...
@@ -11,14 +11,18 @@ import scipy.stats as st
samples
=
5
def
from_maybe
(
default
,
x
):
return
default
if
x
is
None
else
x
# Edge Spec should be ("transitions", str) or ("zero-frequency", str)
def
coalg_file
(
states
,
monoid
,
symbols
,
edge_spec
,
different_values
,
i
):
if
edge_spec
[
0
]
==
"
transitions
"
:
return
"
bench/wta_%s_%s_t%s_%s_%s_%d
"
%
(
monoid
,
symbols
,
edge_spec
[
1
],
different_values
,
states
,
i
)
from_maybe
(
""
,
different_values
)
,
states
,
i
)
else
:
return
"
bench/wta_%s_%s_%s_%s_%s_%d
"
%
(
monoid
,
symbols
,
edge_spec
[
1
],
different_values
,
states
,
i
)
from_maybe
(
""
,
different_values
)
,
states
,
i
)
def
check_zerotrans
(
args
):
...
...
@@ -54,6 +58,7 @@ def generate(args):
cmd
=
[
generator
,
"
--states
"
,
states
,
"
--monoid
"
,
monoid
,
"
--symbols
"
,
symbols
]
cmd
+=
[
"
--
"
+
edge_spec
[
0
],
edge_spec
[
1
]]
if
not
(
different_values
is
None
):
cmd
+=
[
"
--different-values
"
,
different_values
]
subprocess
.
run
(
cmd
,
stdout
=
open
(
f
,
"
w+
"
))
...
...
@@ -82,7 +87,7 @@ def run_one(args, i):
stats
[
'
monoid
'
]
=
monoid
stats
[
'
symbols
'
]
=
symbols
stats
[
'
edge-spec
'
]
=
str
(
edge_spec
)
stats
[
'
mon-values
'
]
=
different_values
stats
[
'
mon-values
'
]
=
from_maybe
(
""
,
different_values
)
stats
[
'
i
'
]
=
i
return
stats
...
...
@@ -257,7 +262,7 @@ def main():
gen_parser
.
add_argument
(
'
--symbols
'
,
required
=
True
)
gen_parser
.
add_argument
(
'
--zero-frequency
'
)
gen_parser
.
add_argument
(
'
--transitions
'
)
gen_parser
.
add_argument
(
'
--different-values
'
,
required
=
True
)
gen_parser
.
add_argument
(
'
--different-values
'
)
gen_parser
.
set_defaults
(
func
=
generate
)
run_parser
=
subparsers
.
add_parser
(
'
run
'
)
...
...
@@ -267,7 +272,7 @@ def main():
run_parser
.
add_argument
(
'
--symbols
'
,
required
=
True
)
run_parser
.
add_argument
(
'
--zero-frequency
'
)
run_parser
.
add_argument
(
'
--transitions
'
)
run_parser
.
add_argument
(
'
--different-values
'
,
required
=
True
)
run_parser
.
add_argument
(
'
--different-values
'
)
run_parser
.
add_argument
(
'
--stddev
'
,
action
=
'
store_true
'
,
help
=
"
report stddev for timings
"
)
run_parser
.
add_argument
(
...
...
@@ -283,7 +288,7 @@ def main():
bisect_parser
.
add_argument
(
'
--symbols
'
,
required
=
True
)
bisect_parser
.
add_argument
(
'
--zero-frequency
'
)
bisect_parser
.
add_argument
(
'
--transitions
'
)
bisect_parser
.
add_argument
(
'
--different-values
'
,
required
=
True
)
bisect_parser
.
add_argument
(
'
--different-values
'
)
bisect_parser
.
add_argument
(
'
--start-states
'
,
type
=
int
,
default
=
50
)
bisect_parser
.
add_argument
(
'
--good
'
,
type
=
int
)
bisect_parser
.
add_argument
(
'
--bad
'
,
type
=
int
)
...
...
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