potassco-benchmark-tool 2.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- benchmarktool/__init__.py +0 -0
- benchmarktool/entry_points.py +417 -0
- benchmarktool/init/programs/gcat.sh +24 -0
- benchmarktool/init/runscripts/runscript-all.xml +49 -0
- benchmarktool/init/runscripts/runscript-dist.xml +20 -0
- benchmarktool/init/runscripts/runscript-example.xml +31 -0
- benchmarktool/init/runscripts/runscript-seq.xml +27 -0
- benchmarktool/init/templates/seq-generic-single.sh +27 -0
- benchmarktool/init/templates/seq-generic-zip.sh +14 -0
- benchmarktool/init/templates/seq-generic.sh +12 -0
- benchmarktool/init/templates/single.dist +25 -0
- benchmarktool/result/__init__.py +0 -0
- benchmarktool/result/ipynb_gen.py +477 -0
- benchmarktool/result/ods_config.py +42 -0
- benchmarktool/result/ods_gen.py +714 -0
- benchmarktool/result/parser.py +167 -0
- benchmarktool/result/result.py +453 -0
- benchmarktool/resultparser/__init__.py +0 -0
- benchmarktool/resultparser/clasp.py +88 -0
- benchmarktool/runscript/__init__.py +0 -0
- benchmarktool/runscript/parser.py +477 -0
- benchmarktool/runscript/runscript.py +1481 -0
- benchmarktool/tools.py +82 -0
- potassco_benchmark_tool-2.1.1.dist-info/METADATA +112 -0
- potassco_benchmark_tool-2.1.1.dist-info/RECORD +29 -0
- potassco_benchmark_tool-2.1.1.dist-info/WHEEL +5 -0
- potassco_benchmark_tool-2.1.1.dist-info/entry_points.txt +2 -0
- potassco_benchmark_tool-2.1.1.dist-info/licenses/LICENSE +21 -0
- potassco_benchmark_tool-2.1.1.dist-info/top_level.txt +1 -0
benchmarktool/tools.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Created on Jan 15, 2010
|
|
3
|
+
|
|
4
|
+
@author: Roland Kaminski
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import re
|
|
9
|
+
import stat
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def mkdir_p(path: str) -> None:
|
|
13
|
+
"""
|
|
14
|
+
Simulates `mkdir -p` functionality.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
path (str): A string holding the path to create.
|
|
18
|
+
"""
|
|
19
|
+
if not os.path.exists(path):
|
|
20
|
+
os.makedirs(path)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def xml_to_seconds_time(str_rep: str) -> int:
|
|
24
|
+
"""
|
|
25
|
+
Converts `[<D>d] [<H>h] [<M>m] [<S>s]` time format to seconds.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
str_rep (str): String representation.
|
|
29
|
+
"""
|
|
30
|
+
mult = {"d": 86400, "h": 3600, "m": 60, "s": 1, "so": 1}
|
|
31
|
+
m = re.fullmatch(
|
|
32
|
+
r"(?P<so>[0-9]+)|(?:(?P<d>[0-9]+)d)?\s*(?:(?P<h>[0-9]+)h)?\s*(?:(?P<m>[0-9]+)m)?\s*(?:(?P<s>[0-9]+)s)?", str_rep
|
|
33
|
+
)
|
|
34
|
+
accu = 0
|
|
35
|
+
if m is not None:
|
|
36
|
+
for key, val in m.groupdict().items():
|
|
37
|
+
if val is not None:
|
|
38
|
+
accu += int(val) * mult[key]
|
|
39
|
+
return accu
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def seconds_to_xml_time(int_rep: int) -> str:
|
|
43
|
+
"""
|
|
44
|
+
Converts time in seconds to `[<D>d] [<H>h] [<M>m] [<S>s]` time format.
|
|
45
|
+
|
|
46
|
+
Attributes:
|
|
47
|
+
int_rep (int): Int representation.
|
|
48
|
+
"""
|
|
49
|
+
s = int_rep % 60
|
|
50
|
+
int_rep //= 60
|
|
51
|
+
m = int_rep % 60
|
|
52
|
+
int_rep //= 60
|
|
53
|
+
h = int_rep % 24
|
|
54
|
+
d = int_rep // 24
|
|
55
|
+
return "{0:02}d {1:02}h {2:02}m {3:02}s".format(d, h, m, s)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def seconds_to_slurm_time(int_rep: int) -> str:
|
|
59
|
+
"""
|
|
60
|
+
Converts time in seconds to `DD-HH:MM:SS` time format.
|
|
61
|
+
|
|
62
|
+
Attributes:
|
|
63
|
+
int_rep (int): Int representation.
|
|
64
|
+
"""
|
|
65
|
+
s = int_rep % 60
|
|
66
|
+
int_rep //= 60
|
|
67
|
+
m = int_rep % 60
|
|
68
|
+
int_rep //= 60
|
|
69
|
+
h = int_rep % 24
|
|
70
|
+
d = int_rep // 24
|
|
71
|
+
return "{0:02}-{1:02}:{2:02}:{3:02}".format(d, h, m, s)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def set_executable(filename: str) -> None:
|
|
75
|
+
"""
|
|
76
|
+
Set execution permissions for given file.
|
|
77
|
+
|
|
78
|
+
Attributes:
|
|
79
|
+
filename (str): A file
|
|
80
|
+
"""
|
|
81
|
+
filestat = os.stat(filename)
|
|
82
|
+
os.chmod(filename, filestat[0] | stat.S_IXUSR)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: potassco-benchmark-tool
|
|
3
|
+
Version: 2.1.1
|
|
4
|
+
Summary: A benchmark-tool for ASP based systems.
|
|
5
|
+
Author: Roland Kaminski, Tom Schmidt
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Potassco
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://potassco.org
|
|
29
|
+
Project-URL: Repository, https://github.com/potassco/benchmark-tool
|
|
30
|
+
Project-URL: Documentation, https://potassco.org/benchmark-tool/
|
|
31
|
+
Keywords: benchmarking,benchmarks,Potassco
|
|
32
|
+
Requires-Python: >=3.10
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
License-File: LICENSE
|
|
35
|
+
Requires-Dist: lxml
|
|
36
|
+
Requires-Dist: pandas
|
|
37
|
+
Requires-Dist: odswriter
|
|
38
|
+
Requires-Dist: pyarrow
|
|
39
|
+
Requires-Dist: nbformat
|
|
40
|
+
Provides-Extra: format
|
|
41
|
+
Requires-Dist: black; extra == "format"
|
|
42
|
+
Requires-Dist: isort; extra == "format"
|
|
43
|
+
Requires-Dist: autoflake; extra == "format"
|
|
44
|
+
Provides-Extra: lint-pylint
|
|
45
|
+
Requires-Dist: pylint; extra == "lint-pylint"
|
|
46
|
+
Provides-Extra: typecheck
|
|
47
|
+
Requires-Dist: types-setuptools; extra == "typecheck"
|
|
48
|
+
Requires-Dist: mypy; extra == "typecheck"
|
|
49
|
+
Provides-Extra: test
|
|
50
|
+
Requires-Dist: coverage[toml]; extra == "test"
|
|
51
|
+
Provides-Extra: doc
|
|
52
|
+
Requires-Dist: mkdocs; extra == "doc"
|
|
53
|
+
Requires-Dist: mkdocs-material; extra == "doc"
|
|
54
|
+
Requires-Dist: mkdocstrings[python]; extra == "doc"
|
|
55
|
+
Provides-Extra: dev
|
|
56
|
+
Requires-Dist: benchmarktool[lint_pylint,test,typecheck]; extra == "dev"
|
|
57
|
+
Provides-Extra: plot
|
|
58
|
+
Requires-Dist: plotly; extra == "plot"
|
|
59
|
+
Requires-Dist: ipywidgets; extra == "plot"
|
|
60
|
+
Requires-Dist: anywidget; extra == "plot"
|
|
61
|
+
Requires-Dist: jupyter; extra == "plot"
|
|
62
|
+
Dynamic: license-file
|
|
63
|
+
|
|
64
|
+
# benchmarktool
|
|
65
|
+
|
|
66
|
+
A tool to easier generate, run and evaluate benchmarks.
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
The `setuptools` package is required to run the commands below. We recommend
|
|
71
|
+
the usage of conda, which already includes `setuptools` in its default python
|
|
72
|
+
installation. Any python version newer than 3.10 is supported.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
$ git clone https://github.com/potassco/benchmark-tool
|
|
76
|
+
$ cd benchmark-tool
|
|
77
|
+
$ conda create -n <env-name> python=3.10
|
|
78
|
+
$ conda activate <env-name>
|
|
79
|
+
$ pip install .
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The documentation can be accessed [here](https://potassco.org/benchmark-tool/)
|
|
83
|
+
or build and hosted using:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
$ pip install .[doc]
|
|
87
|
+
$ mkdocs serve
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
And afterwards accessed at `http://localhost:8000/systems/benchmark-tool/`.
|
|
91
|
+
|
|
92
|
+
## Usage
|
|
93
|
+
|
|
94
|
+
You can check a successful installation by running
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
$ btool -h
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Supported subcommands in order of use:
|
|
101
|
+
|
|
102
|
+
- `init` Prepare the benchmark environment
|
|
103
|
+
- `gen` Generate scripts from runscript
|
|
104
|
+
- `run-dist` Run distributed jobs
|
|
105
|
+
- `verify` Check for runlim errors and re-run failed instances
|
|
106
|
+
- `eval` Collect results
|
|
107
|
+
- `conv` Convert results to ODS or other formats
|
|
108
|
+
|
|
109
|
+
For more information and examples check the documentation.
|
|
110
|
+
|
|
111
|
+
> **_NOTE:_** This project is still in active development. If you encounter any
|
|
112
|
+
> bugs, have ideas for improvement or feature requests, please open an issue.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
benchmarktool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
benchmarktool/entry_points.py,sha256=acy_lXchHqDyHVhQKabo8rgI8OszJwtUN3Y7eKfwBFA,13884
|
|
3
|
+
benchmarktool/tools.py,sha256=pvSvLpXmr6Q1KPP4hc5mGiz15J9Go-dm0t1ZHSDGFLQ,1886
|
|
4
|
+
benchmarktool/init/programs/gcat.sh,sha256=QbEE0VpU2Ea3QQrRCrdRUkVxSNDghN7VhRE32QwAJME,379
|
|
5
|
+
benchmarktool/init/runscripts/runscript-all.xml,sha256=uZEAO17wnoEAW4s89XvBaWRsha4MhjJCU_umJ3vrnSI,2126
|
|
6
|
+
benchmarktool/init/runscripts/runscript-dist.xml,sha256=hBHlux2_vmhuSf0jcCAi-TBN-zcvNGbFfKBxPACFUB4,676
|
|
7
|
+
benchmarktool/init/runscripts/runscript-example.xml,sha256=6ah7dEEYhVTj7e8PQxdJhwdGufogJUDDgDNC9RfOPTQ,889
|
|
8
|
+
benchmarktool/init/runscripts/runscript-seq.xml,sha256=pRCeVaJHbxa6y8kcoKYSJBJkvfeEKpe4Sn5gv4UE_NU,833
|
|
9
|
+
benchmarktool/init/templates/seq-generic-single.sh,sha256=UGcEN2GbtOW5svPD-xMw27dwd_q7BXZa5gl4gISEG-I,606
|
|
10
|
+
benchmarktool/init/templates/seq-generic-zip.sh,sha256=mb5KDkHlpLjik9G9NWHlkPakdwjWk8MgUA21ys57SAs,378
|
|
11
|
+
benchmarktool/init/templates/seq-generic.sh,sha256=HwHu1swEdP2bvExWt_CcwaYIxD8PWXIgDYyaXgngJgM,336
|
|
12
|
+
benchmarktool/init/templates/single.dist,sha256=X86hhkddknqSdwzkHtYMt5fN0K-cuC4PIeVM79ZbwnI,574
|
|
13
|
+
benchmarktool/result/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
benchmarktool/result/ipynb_gen.py,sha256=ti-DEUQkOo98Yxf5lk9zGcjGJ_QPAVvQ3wkfkeBg_AY,14783
|
|
15
|
+
benchmarktool/result/ods_config.py,sha256=e86MbvDbB8CJh_deDf6LaEGOi_CKvspCfwJsnJm8CTk,2156
|
|
16
|
+
benchmarktool/result/ods_gen.py,sha256=XJEIlnN29iqG35yu6QRoYaDDbnus9uwwrL5kOHhvxmc,29055
|
|
17
|
+
benchmarktool/result/parser.py,sha256=AeM0KZlTMPL8csOIBG3JD5A4yzxoXcra1kom87NCeB8,6625
|
|
18
|
+
benchmarktool/result/result.py,sha256=v-bz9a2lR6POVitZGT-O6NSiOYWL5fWUN-pZXzUdbFs,14302
|
|
19
|
+
benchmarktool/resultparser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
benchmarktool/resultparser/clasp.py,sha256=q5W4gbysI3QTgBnOQi5kW8QZo50z5atWjT9afQ6hiCA,3508
|
|
21
|
+
benchmarktool/runscript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
benchmarktool/runscript/parser.py,sha256=ciBDnDOH3CjwrRdbUpcVjAt1PxbXUDO76l599uoH6nY,19961
|
|
23
|
+
benchmarktool/runscript/runscript.py,sha256=hFeTq6NJ1e0RabWJUPxi8se-aZiEjYl_zrBuY6NDuwQ,54352
|
|
24
|
+
potassco_benchmark_tool-2.1.1.dist-info/licenses/LICENSE,sha256=eiYGM1U3OL1PkD5Leken0kocRuk_9Inhq6aiyfSWYYs,1065
|
|
25
|
+
potassco_benchmark_tool-2.1.1.dist-info/METADATA,sha256=BaGNhNrmVuELJaXFFgvVNFMQoOmlLet1MQN12Cwqp2k,4000
|
|
26
|
+
potassco_benchmark_tool-2.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
27
|
+
potassco_benchmark_tool-2.1.1.dist-info/entry_points.txt,sha256=pHyaCS16SLT-m0ZpybGtvg2PxI5TNKonBUH1DJyeKVY,58
|
|
28
|
+
potassco_benchmark_tool-2.1.1.dist-info/top_level.txt,sha256=raOGCL-YmmJFALuaHUXcH4bFccgTAB7JVLPxFFqFL7Y,14
|
|
29
|
+
potassco_benchmark_tool-2.1.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Potassco
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
benchmarktool
|