coco-experiment 2.7.3__tar.gz → 2.7.4__tar.gz
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.
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/PKG-INFO +1 -1
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/meson.build +1 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/_version.py +1 -1
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/coco.c +1 -1
- coco_experiment-2.7.4/src/cocoex/download_example.py +45 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/noiser.py +2 -1
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/utilities.py +7 -1
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/.gitignore +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/LICENSE +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/README.md +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/pyproject.toml +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/scripts/run-doctest.py +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/__init__.py +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/bare_problem.pyx +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/coco.h +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/exceptions.py +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/interface.pyx +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/src/cocoex/solvers.py +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/tests/bbob2009_testcases.txt +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/tests/bbob2009_testcases2.txt +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/tests/test_bare_problem.py +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/tests/test_regression.py +0 -0
- {coco_experiment-2.7.3 → coco_experiment-2.7.4}/tests/test_suite.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: coco-experiment
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.4
|
|
4
4
|
Summary: Benchmarking framework for all types of black-box optimization algorithms.
|
|
5
5
|
Project-URL: Homepage, https://github.com/numbbo/coco-experiment
|
|
6
6
|
Project-URL: Documentation, https://numbbo.github.io/coco-doc/apidocs/cocoex/
|
|
@@ -64,6 +64,7 @@ dep_numpy = declare_dependency(include_directories: inc_numpy, compile_args: cfl
|
|
|
64
64
|
python_sources = [
|
|
65
65
|
'src/cocoex/__init__.py',
|
|
66
66
|
'src/cocoex/_version.py',
|
|
67
|
+
'src/cocoex/download_example.py',
|
|
67
68
|
'src/cocoex/exceptions.py',
|
|
68
69
|
'src/cocoex/noiser.py',
|
|
69
70
|
'src/cocoex/solvers.py',
|
|
@@ -31526,7 +31526,7 @@ void coco_archive_free(coco_archive_t *archive) {
|
|
|
31526
31526
|
* don't change, don't track in version control!
|
|
31527
31527
|
*/
|
|
31528
31528
|
|
|
31529
|
-
const char *coco_version = "2.7.
|
|
31529
|
+
const char *coco_version = "2.7.4";
|
|
31530
31530
|
#line 1 "coco_runtime_c.c"
|
|
31531
31531
|
/**
|
|
31532
31532
|
* @file coco_runtime_c.c
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Download example scripts from GitHub to a local folder, by default `cocoex-example`
|
|
2
|
+
in the current folder.
|
|
3
|
+
|
|
4
|
+
Usage::
|
|
5
|
+
|
|
6
|
+
python -m cocoex.download_example [folder_name]
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
import os
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
default_local_folder = 'cocoex-example'
|
|
13
|
+
|
|
14
|
+
remote_folder = 'https://raw.githubusercontent.com/numbbo/coco-experiment/main/build/python/example/'
|
|
15
|
+
|
|
16
|
+
file_names = ['mkl_bugfix.py',
|
|
17
|
+
'example_experiment_simple.py',
|
|
18
|
+
'example_experiment_complete.py',
|
|
19
|
+
'example_experiment_non_anytime.py',
|
|
20
|
+
'example_experiment_parameter_sweep.py',
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
def main(folder=None):
|
|
24
|
+
"""download example scripts from GitHub into `folder`, by default `./cocoex-example`"""
|
|
25
|
+
try:
|
|
26
|
+
import urllib.request
|
|
27
|
+
except ImportError:
|
|
28
|
+
print('Install urllib (`pip install urllib`) to download example')
|
|
29
|
+
raise
|
|
30
|
+
if folder is None:
|
|
31
|
+
folder = default_local_folder
|
|
32
|
+
if os.path.exists(folder):
|
|
33
|
+
raise ValueError('local target folder {0} already exists. Remove the folder\n'
|
|
34
|
+
'or pass another folder name as argument to `cocoex.download_example`'
|
|
35
|
+
.format(folder))
|
|
36
|
+
os.mkdir(folder)
|
|
37
|
+
for file_name in file_names:
|
|
38
|
+
with urllib.request.urlopen(remote_folder + file_name) as f:
|
|
39
|
+
d = f.read().decode('utf-8')
|
|
40
|
+
with open(folder + '/' + file_name, 'w') as f:
|
|
41
|
+
f.write(d)
|
|
42
|
+
print(' example scripts have been downloaded to {0}'.format(folder))
|
|
43
|
+
|
|
44
|
+
if __name__ == '__main__':
|
|
45
|
+
main(sys.argv[1] if len(sys.argv) > 1 else None)
|
|
@@ -70,7 +70,8 @@ class Noisifier:
|
|
|
70
70
|
noise generator and the numbers scaled by pi/2 such that P(number > k)
|
|
71
71
|
equals about 1/k when k >= 5.
|
|
72
72
|
|
|
73
|
-
See also https://github.com/numbbo/coco-experiment/
|
|
73
|
+
See also https://github.com/numbbo/coco-experiment/issues/36 and
|
|
74
|
+
https://github.com/numbbo/coco-experiment/blob/main/build/python/example/example_experiment_complete.py
|
|
74
75
|
|
|
75
76
|
"""
|
|
76
77
|
def __init__(self, p_add=0.2, p_subtract=0.0, p_epsilon=0, epsilon=1e-4,
|
|
@@ -742,7 +742,13 @@ class ExperimentRepeater:
|
|
|
742
742
|
return sum(self.trials(problem))
|
|
743
743
|
return sum(self.all(self.n_trials).values())
|
|
744
744
|
def track(self, problem):
|
|
745
|
-
"""record problem instance evaluations and success (target hit)
|
|
745
|
+
"""record problem instance evaluations and success (final target hit).
|
|
746
|
+
|
|
747
|
+
Track data to decide (later) whether more experiments or sweeps are
|
|
748
|
+
needed. `track` requires `problem` to have the attributes
|
|
749
|
+
``id_function, dimension, id_instance, evaluations`` and
|
|
750
|
+
``final_target_hit``.
|
|
751
|
+
"""
|
|
746
752
|
fun, dim, iinst = self.problem_to_ids(problem)
|
|
747
753
|
if (fun, dim) not in self._data:
|
|
748
754
|
self._data[(fun, dim)] = _collections.defaultdict(list)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|