potassco-benchmark-tool 2.1.1__py3-none-any.whl → 2.2.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/tools.py CHANGED
@@ -4,9 +4,12 @@ Created on Jan 15, 2010
4
4
  @author: Roland Kaminski
5
5
  """
6
6
 
7
+ import importlib.util
7
8
  import os
8
9
  import re
9
10
  import stat
11
+ import sys
12
+ from types import ModuleType
10
13
 
11
14
 
12
15
  def mkdir_p(path: str) -> None:
@@ -52,7 +55,7 @@ def seconds_to_xml_time(int_rep: int) -> str:
52
55
  int_rep //= 60
53
56
  h = int_rep % 24
54
57
  d = int_rep // 24
55
- return "{0:02}d {1:02}h {2:02}m {3:02}s".format(d, h, m, s)
58
+ return f"{d:02}d {h:02}h {m:02}m {s:02}s"
56
59
 
57
60
 
58
61
  def seconds_to_slurm_time(int_rep: int) -> str:
@@ -68,7 +71,7 @@ def seconds_to_slurm_time(int_rep: int) -> str:
68
71
  int_rep //= 60
69
72
  h = int_rep % 24
70
73
  d = int_rep // 24
71
- return "{0:02}-{1:02}:{2:02}:{3:02}".format(d, h, m, s)
74
+ return f"{d:02}-{h:02}:{m:02}:{s:02}"
72
75
 
73
76
 
74
77
  def set_executable(filename: str) -> None:
@@ -80,3 +83,20 @@ def set_executable(filename: str) -> None:
80
83
  """
81
84
  filestat = os.stat(filename)
82
85
  os.chmod(filename, filestat[0] | stat.S_IXUSR)
86
+
87
+
88
+ def import_from_path(module_name: str, file_path: str) -> ModuleType: # nocoverage
89
+ """
90
+ Helper function to import modules from path.
91
+
92
+ Attributes:
93
+ module_name (str): Name of the module.
94
+ file_path (str): Path to the module.
95
+ """
96
+ spec = importlib.util.spec_from_file_location(module_name, file_path)
97
+ assert spec is not None
98
+ module = importlib.util.module_from_spec(spec)
99
+ sys.modules[module_name] = module
100
+ assert spec.loader is not None
101
+ spec.loader.exec_module(module)
102
+ return module
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: potassco-benchmark-tool
3
- Version: 2.1.1
3
+ Version: 2.2.1
4
4
  Summary: A benchmark-tool for ASP based systems.
5
5
  Author: Roland Kaminski, Tom Schmidt
6
6
  License: MIT License
@@ -34,7 +34,7 @@ Description-Content-Type: text/markdown
34
34
  License-File: LICENSE
35
35
  Requires-Dist: lxml
36
36
  Requires-Dist: pandas
37
- Requires-Dist: odswriter
37
+ Requires-Dist: xlsxwriter
38
38
  Requires-Dist: pyarrow
39
39
  Requires-Dist: nbformat
40
40
  Provides-Extra: format
@@ -67,16 +67,29 @@ A tool to easier generate, run and evaluate benchmarks.
67
67
 
68
68
  ## Installation
69
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.
70
+ The benchmark tool can be installed with any Python version newer than 3.10
71
+ using pip:
73
72
 
74
73
  ```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 .
74
+ pip install potassco-benchmark-tool
75
+ ```
76
+
77
+ To access the latest updates and fixes you can either use:
78
+
79
+ ```bash
80
+ pip install git+https://github.com/potassco/benchmark-tool
81
+ ```
82
+
83
+ Or alternatively build the tool yourself, which requires the `setuptools`
84
+ package. We recommend using conda, which includes `setuptools` in its default
85
+ Python installation. To build the tool manually run the following commands:
86
+
87
+ ```bash
88
+ git clone https://github.com/potassco/benchmark-tool
89
+ cd benchmark-tool
90
+ conda create -n <env-name> python=3.10
91
+ conda activate <env-name>
92
+ pip install .
80
93
  ```
81
94
 
82
95
  The documentation can be accessed [here](https://potassco.org/benchmark-tool/)
@@ -104,7 +117,7 @@ Supported subcommands in order of use:
104
117
  - `run-dist` Run distributed jobs
105
118
  - `verify` Check for runlim errors and re-run failed instances
106
119
  - `eval` Collect results
107
- - `conv` Convert results to ODS or other formats
120
+ - `conv` Convert results to spreadsheet and more
108
121
 
109
122
  For more information and examples check the documentation.
110
123
 
@@ -0,0 +1,26 @@
1
+ benchmarktool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ benchmarktool/entry_points.py,sha256=_eApMgsaIIJF_PbgF1-OGQZLUmlDBUSQKqBcdp_69x4,15224
3
+ benchmarktool/tools.py,sha256=2UpzXSryvliaytjBe3xzNEGSHJeYF_q5h12IMOW-nzE,2456
4
+ benchmarktool/init/programs/gcat.sh,sha256=QbEE0VpU2Ea3QQrRCrdRUkVxSNDghN7VhRE32QwAJME,379
5
+ benchmarktool/init/runscripts/runscript-all.xml,sha256=uzEmMW8Phudq71wzSGvNGENGGXYIG6CU16mKutJ_kt8,2159
6
+ benchmarktool/init/runscripts/runscript-dist.xml,sha256=MR7tsdaobHhafdCCmd3J70-HuoCOguZQvR89VscTz5U,705
7
+ benchmarktool/init/runscripts/runscript-example.xml,sha256=EvccB-7DapkVSKhwCm6HrPnvAqDYTxo7ZNvv6jjg3uw,917
8
+ benchmarktool/init/runscripts/runscript-seq.xml,sha256=pRCeVaJHbxa6y8kcoKYSJBJkvfeEKpe4Sn5gv4UE_NU,833
9
+ benchmarktool/init/templates/seq-generic.sh,sha256=kTz-vq80onrRyVvXztpr8X9aGfcBJPFTzHmdR2YczVI,571
10
+ benchmarktool/init/templates/single.dist,sha256=X86hhkddknqSdwzkHtYMt5fN0K-cuC4PIeVM79ZbwnI,574
11
+ benchmarktool/result/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ benchmarktool/result/ipynb_gen.py,sha256=QGnU4E3am8K0kPlaKBAh_1utNwWmzc6Um97WSwGuFWg,14854
13
+ benchmarktool/result/parser.py,sha256=AeM0KZlTMPL8csOIBG3JD5A4yzxoXcra1kom87NCeB8,6625
14
+ benchmarktool/result/result.py,sha256=7wDNlrm4qF2vi1HoXFMx18aqjgWuDiNfh9-UXlYZQf4,14703
15
+ benchmarktool/result/xlsx_gen.py,sha256=NeUHDX34qXDdG0AWR7sL0-Pt6jc-jhKeMZD3GDhPNHU,39927
16
+ benchmarktool/resultparser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ benchmarktool/resultparser/clasp.py,sha256=8ZE1zcaV6D9o2lx_qq_s6MlgRQi4fkO5LTbBVFmhBXA,4035
18
+ benchmarktool/runscript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ benchmarktool/runscript/parser.py,sha256=TzOP_9F9viJ1eEzEs5lYGK-q_bwkEv5blgRdU49MNdE,23874
20
+ benchmarktool/runscript/runscript.py,sha256=ymvCOgn-A_PF4hXJ2B1tHGqKy2S9EjMj3i26aMG7O-0,54886
21
+ potassco_benchmark_tool-2.2.1.dist-info/licenses/LICENSE,sha256=eiYGM1U3OL1PkD5Leken0kocRuk_9Inhq6aiyfSWYYs,1065
22
+ potassco_benchmark_tool-2.2.1.dist-info/METADATA,sha256=-NuGu5nIXc6-yQQRA-u_rZo87juxeUN_trbWPp3gepU,4270
23
+ potassco_benchmark_tool-2.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ potassco_benchmark_tool-2.2.1.dist-info/entry_points.txt,sha256=pHyaCS16SLT-m0ZpybGtvg2PxI5TNKonBUH1DJyeKVY,58
25
+ potassco_benchmark_tool-2.2.1.dist-info/top_level.txt,sha256=raOGCL-YmmJFALuaHUXcH4bFccgTAB7JVLPxFFqFL7Y,14
26
+ potassco_benchmark_tool-2.2.1.dist-info/RECORD,,
@@ -1,27 +0,0 @@
1
- #!/bin/bash
2
- # https://github.com/arminbiere/runlim
3
-
4
- CAT="{run.root}/programs/gcat.sh"
5
-
6
- cd "$(dirname $0)"
7
-
8
- runner=( "{run.root}/programs/runlim" \
9
- --single \
10
- --space-limit={run.memout} \
11
- --output-file=runsolver.watcher \
12
- --real-time-limit={run.timeout} \
13
- "{run.root}/programs/{run.solver}" {run.args})
14
-
15
- input=( {run.files} {run.encodings} )
16
-
17
- if [[ ! -e .finished ]]; then
18
- {{
19
- if file -b --mime-type -L "${{input[@]}}" | grep -qv "text/"; then
20
- "$CAT" "${{input[@]}}" | "${{runner[@]}}"
21
- else
22
- "${{runner[@]}}" "${{input[@]}}"
23
- fi
24
- }} > runsolver.solver
25
- fi
26
-
27
- touch .finished
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
- # https://github.com/arminbiere/runlim
3
-
4
- CAT="{run.root}/programs/gcat.sh"
5
-
6
- cd "$(dirname $0)"
7
-
8
- [[ -e .finished ]] || $CAT {run.files} {run.encodings} | "{run.root}/programs/runlim" \
9
- --space-limit={run.memout} \
10
- --output-file=runsolver.watcher \
11
- --real-time-limit={run.timeout} \
12
- "{run.root}/programs/{run.solver}" {run.args} > runsolver.solver
13
-
14
- touch .finished
@@ -1,42 +0,0 @@
1
- """
2
- ODS configuration.
3
- """
4
-
5
- STYLES_XML = """<?xml version="1.0" encoding="UTF-8"?>
6
- <office:document-styles
7
- xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
8
- xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
9
- xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
10
- xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
11
- xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
12
- xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
13
- xmlns:xlink="http://www.w3.org/1999/xlink"
14
- xmlns:dc="http://purl.org/dc/elements/1.1/"
15
- xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
16
- xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
17
- xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
18
- xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
19
- xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
20
- xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
21
- xmlns:math="http://www.w3.org/1998/Math/MathML"
22
- xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
23
- xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
24
- xmlns:ooo="http://openoffice.org/2004/office"
25
- xmlns:ooow="http://openoffice.org/2004/writer"
26
- xmlns:oooc="http://openoffice.org/2004/calc"
27
- xmlns:dom="http://www.w3.org/2001/xml-events"
28
- xmlns:rpt="http://openoffice.org/2005/report"
29
- xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
30
- xmlns:rdfa="http://docs.oasis-open.org/opendocument/meta/rdfa#"
31
- office:version="1.2">
32
- <office:styles>
33
- <style:style style:name="Default" style:family="table-cell"/>
34
- <style:style style:name="cellBest" style:family="table-cell" style:parent-style-name="Default">
35
- <style:table-cell-properties fo:background-color="#00ff00"/>
36
- </style:style>
37
- <style:style style:name="cellWorst" style:family="table-cell" style:parent-style-name="Default">
38
- <style:table-cell-properties fo:background-color="#ff0000"/>
39
- </style:style>
40
- </office:styles>
41
- </office:document-styles>
42
- """