algorhino-anemone 0.1.10__tar.gz → 0.1.11__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.
- {algorhino_anemone-0.1.10/src/algorhino_anemone.egg-info → algorhino_anemone-0.1.11}/PKG-INFO +6 -6
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/pyproject.toml +25 -17
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11/src/algorhino_anemone.egg-info}/PKG-INFO +6 -6
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/requires.txt +5 -5
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/__init__.py +1 -2
- algorhino_anemone-0.1.11/src/anemone/basics.py +6 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/factory.py +13 -23
- algorhino_anemone-0.1.11/src/anemone/indices/__init__.py +1 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/__init__.py +2 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/factory.py +13 -8
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/node_exploration_manager.py +60 -55
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/__init__.py +2 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/factory.py +16 -14
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/index_data.py +20 -24
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/index_types.py +5 -7
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nn/torch_evaluator.py +18 -11
- algorhino_anemone-0.1.11/src/anemone/node_evaluation/__init__.py +1 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_direct_evaluation/__init__.py +2 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_direct_evaluation/factory.py +1 -1
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_direct_evaluation/node_direct_evaluator.py +19 -42
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_tree_evaluation/node_minmax_evaluation.py +113 -115
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation.py +11 -8
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation_factory.py +5 -5
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_factory/__init__.py +2 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_factory/algorithm_node_factory.py +3 -8
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_factory/base.py +5 -12
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/__init__.py +5 -6
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/branch_explorer.py +18 -21
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/factory.py +16 -16
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/node_selector.py +6 -12
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/node_selector_args.py +2 -5
- algorhino_anemone-0.1.11/src/anemone/node_selector/node_selector_types.py +11 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/notations_and_statics.py +4 -10
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/opening_instructions.py +37 -57
- algorhino_anemone-0.1.11/src/anemone/node_selector/recurzipf/__init__.py +1 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/recurzipf/recur_zipf_base.py +14 -42
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/sequool/__init__.py +2 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/sequool/factory.py +3 -8
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/sequool/sequool.py +32 -50
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/uniform/__init__.py +1 -2
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/node_selector/uniform/uniform.py +10 -18
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nodes/__init__.py +2 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nodes/algorithm_node/__init__.py +1 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nodes/algorithm_node/algorithm_node.py +35 -37
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nodes/itree_node.py +25 -31
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nodes/tree_node.py +30 -29
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nodes/tree_traversal.py +10 -11
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/nodes/utils.py +14 -13
- algorhino_anemone-0.1.11/src/anemone/progress_monitor/__init__.py +1 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/progress_monitor/progress_monitor.py +55 -75
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/recommender_rule/__init__.py +1 -2
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/recommender_rule/recommender_rule.py +7 -16
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/search_factory/__init__.py +2 -3
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/search_factory/search_factory.py +25 -28
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/tree_and_value_branch_selector.py +25 -18
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/tree_exploration.py +30 -41
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/__init__.py +3 -4
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/algorithm_node_tree_manager.py +15 -29
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/factory.py +3 -5
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/tree_expander.py +13 -15
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/tree_manager.py +14 -25
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/trees/__init__.py +3 -5
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/trees/descendants.py +80 -115
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/trees/factory.py +9 -13
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/trees/tree.py +8 -11
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/trees/tree_visualization.py +10 -10
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/__init__.py +4 -5
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/algorithm_node_updater.py +11 -13
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/factory.py +2 -4
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/index_block.py +13 -14
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/index_updater.py +7 -12
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/minmax_evaluation_updater.py +7 -12
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/updates_file.py +27 -26
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/updates/value_block.py +10 -10
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/utils/comparable.py +3 -4
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/utils/dataclass.py +10 -13
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/utils/dict_of_numbered_dict_with_pointer_on_max.py +16 -23
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/utils/logger.py +13 -12
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/utils/my_value_sorted_dict.py +4 -7
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/utils/small_tools.py +16 -18
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/tests/test_indices.py +8 -11
- algorhino_anemone-0.1.10/src/anemone/basics.py +0 -23
- algorhino_anemone-0.1.10/src/anemone/indices/__init__.py +0 -0
- algorhino_anemone-0.1.10/src/anemone/node_evaluation/__init__.py +0 -0
- algorhino_anemone-0.1.10/src/anemone/node_selector/node_selector_types.py +0 -15
- algorhino_anemone-0.1.10/src/anemone/node_selector/recurzipf/__init__.py +0 -0
- algorhino_anemone-0.1.10/src/anemone/progress_monitor/__init__.py +0 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/LICENSE +0 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/README.md +0 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/setup.cfg +0 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/SOURCES.txt +0 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/dependency_links.txt +0 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/top_level.txt +0 -0
- {algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/state_transition.py +0 -0
{algorhino_anemone-0.1.10/src/algorhino_anemone.egg-info → algorhino_anemone-0.1.11}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: algorhino-anemone
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: anemone searches trees
|
|
5
5
|
Author-email: Victor Gabillon <victorgabillon@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -12,18 +12,18 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Python: >=3.13
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: valanga>=0.1.
|
|
16
|
-
Requires-Dist: atomheart>=0.1.
|
|
15
|
+
Requires-Dist: valanga>=0.1.14
|
|
16
|
+
Requires-Dist: atomheart>=0.1.7
|
|
17
17
|
Requires-Dist: rich
|
|
18
18
|
Requires-Dist: sortedcollections>=2.1.0
|
|
19
19
|
Requires-Dist: graphviz
|
|
20
20
|
Provides-Extra: test
|
|
21
|
-
Requires-Dist: pytest>=
|
|
21
|
+
Requires-Dist: pytest>=9.0.2; extra == "test"
|
|
22
22
|
Requires-Dist: coverage; extra == "test"
|
|
23
23
|
Requires-Dist: pytest-cov>=6.0.0; extra == "test"
|
|
24
24
|
Provides-Extra: lint
|
|
25
|
-
Requires-Dist: ruff>=0.
|
|
26
|
-
Requires-Dist: pylint>=
|
|
25
|
+
Requires-Dist: ruff>=0.15.0; extra == "lint"
|
|
26
|
+
Requires-Dist: pylint>=4.0.4; extra == "lint"
|
|
27
27
|
Provides-Extra: typecheck
|
|
28
28
|
Requires-Dist: mypy>=1.18.2; extra == "typecheck"
|
|
29
29
|
Requires-Dist: pyright[nodejs]>=1.1.408; extra == "typecheck"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=80.
|
|
2
|
+
requires = ["setuptools>=80.10.2"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "algorhino-anemone"
|
|
8
|
-
version = "0.1.
|
|
8
|
+
version = "0.1.11"
|
|
9
9
|
description = "anemone searches trees"
|
|
10
10
|
keywords = ["tree", "search"]
|
|
11
11
|
classifiers = [
|
|
@@ -14,8 +14,8 @@ classifiers = [
|
|
|
14
14
|
]
|
|
15
15
|
requires-python = ">=3.13"
|
|
16
16
|
dependencies = [
|
|
17
|
-
"valanga>=0.1.
|
|
18
|
-
"atomheart>=0.1.
|
|
17
|
+
"valanga>=0.1.14",
|
|
18
|
+
"atomheart>=0.1.7",
|
|
19
19
|
"rich",
|
|
20
20
|
"sortedcollections>=2.1.0",
|
|
21
21
|
"graphviz",
|
|
@@ -32,14 +32,14 @@ authors = [
|
|
|
32
32
|
|
|
33
33
|
[project.optional-dependencies]
|
|
34
34
|
test = [
|
|
35
|
-
"pytest>=
|
|
35
|
+
"pytest>=9.0.2",
|
|
36
36
|
"coverage",
|
|
37
37
|
"pytest-cov>=6.0.0",
|
|
38
38
|
]
|
|
39
39
|
|
|
40
40
|
lint = [
|
|
41
|
-
"ruff>=0.
|
|
42
|
-
"pylint>=
|
|
41
|
+
"ruff>=0.15.0",
|
|
42
|
+
"pylint>=4.0.4",
|
|
43
43
|
]
|
|
44
44
|
|
|
45
45
|
typecheck = [
|
|
@@ -160,13 +160,21 @@ line-length = 88
|
|
|
160
160
|
target-version = "py313"
|
|
161
161
|
|
|
162
162
|
# Enable import sorting (alphabetical + group order)
|
|
163
|
-
lint.select = ["I", "F", "E", "B", "TCH"
|
|
163
|
+
lint.select = ["I", "F", "E", "B", "TCH","UP","SIM", "RUF","RET","N","A",
|
|
164
|
+
"ANN", "PERF", "TRY","LOG","RSE","ICN","TID","Q","W","D",
|
|
165
|
+
"ISC","PIE","ERA","TD"] # I = imports, F = pyflakes, E = pycodestyle, TCH = type-checking, B = black
|
|
164
166
|
|
|
165
167
|
# Allow auto-fixing for imports and type-checking imports
|
|
166
|
-
lint.fixable = ["I", "TCH", "F401"]
|
|
168
|
+
lint.fixable = ["I", "TCH", "D","F401","UP","SIM","RET","RUF","E","TRY","PERF","RSE","ANN","PIE","ERA","TD"]
|
|
167
169
|
|
|
168
170
|
# Ignore rules you don't care about
|
|
169
|
-
lint.ignore = [ "E501"
|
|
171
|
+
lint.ignore = [ "E501",
|
|
172
|
+
"ANN401",
|
|
173
|
+
"TD003",
|
|
174
|
+
"TD002",
|
|
175
|
+
"D203", # incompatible with D211
|
|
176
|
+
"D213", # incompatible with D212
|
|
177
|
+
]
|
|
170
178
|
|
|
171
179
|
# Optional: add your first-party package to extend the known group
|
|
172
180
|
[tool.ruff.lint.per-file-ignores]
|
|
@@ -265,19 +273,19 @@ description = "ruff + pylint (fast, no package build/install)"
|
|
|
265
273
|
package = "skip"
|
|
266
274
|
deps = [
|
|
267
275
|
# runtime deps needed for pylint imports (match [project].dependencies)
|
|
268
|
-
"valanga>=0.1.
|
|
269
|
-
"atomheart>=0.1.
|
|
276
|
+
"valanga>=0.1.14",
|
|
277
|
+
"atomheart>=0.1.7",
|
|
270
278
|
"rich",
|
|
271
279
|
"sortedcollections>=2.1.0",
|
|
272
280
|
"graphviz",
|
|
273
281
|
|
|
274
282
|
# tools
|
|
275
|
-
"ruff>=0.
|
|
276
|
-
"pylint>=
|
|
283
|
+
"ruff>=0.15.0",
|
|
284
|
+
"pylint>=4.0.4",
|
|
277
285
|
]
|
|
278
286
|
set_env = { PYTHONPATH = "{toxinidir}/src" }
|
|
279
287
|
commands = [
|
|
280
|
-
["python", "-m", "ruff", "check", "src"
|
|
288
|
+
["python", "-m", "ruff", "check", "src"],
|
|
281
289
|
["python", "-m", "ruff", "format", "--check", "src", "tests"],
|
|
282
290
|
["python", "-m", "pylint", "src/anemone"],
|
|
283
291
|
]
|
|
@@ -290,8 +298,8 @@ description = "mypy + pyright (fast, no package build/install)"
|
|
|
290
298
|
package = "skip"
|
|
291
299
|
deps = [
|
|
292
300
|
# runtime deps for import resolution
|
|
293
|
-
"valanga>=0.1.
|
|
294
|
-
"atomheart>=0.1.
|
|
301
|
+
"valanga>=0.1.14",
|
|
302
|
+
"atomheart>=0.1.7",
|
|
295
303
|
"rich",
|
|
296
304
|
"sortedcollections>=2.1.0",
|
|
297
305
|
"graphviz",
|
{algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11/src/algorhino_anemone.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: algorhino-anemone
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: anemone searches trees
|
|
5
5
|
Author-email: Victor Gabillon <victorgabillon@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -12,18 +12,18 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Requires-Python: >=3.13
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: valanga>=0.1.
|
|
16
|
-
Requires-Dist: atomheart>=0.1.
|
|
15
|
+
Requires-Dist: valanga>=0.1.14
|
|
16
|
+
Requires-Dist: atomheart>=0.1.7
|
|
17
17
|
Requires-Dist: rich
|
|
18
18
|
Requires-Dist: sortedcollections>=2.1.0
|
|
19
19
|
Requires-Dist: graphviz
|
|
20
20
|
Provides-Extra: test
|
|
21
|
-
Requires-Dist: pytest>=
|
|
21
|
+
Requires-Dist: pytest>=9.0.2; extra == "test"
|
|
22
22
|
Requires-Dist: coverage; extra == "test"
|
|
23
23
|
Requires-Dist: pytest-cov>=6.0.0; extra == "test"
|
|
24
24
|
Provides-Extra: lint
|
|
25
|
-
Requires-Dist: ruff>=0.
|
|
26
|
-
Requires-Dist: pylint>=
|
|
25
|
+
Requires-Dist: ruff>=0.15.0; extra == "lint"
|
|
26
|
+
Requires-Dist: pylint>=4.0.4; extra == "lint"
|
|
27
27
|
Provides-Extra: typecheck
|
|
28
28
|
Requires-Dist: mypy>=1.18.2; extra == "typecheck"
|
|
29
29
|
Requires-Dist: pyright[nodejs]>=1.1.408; extra == "typecheck"
|
{algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/requires.txt
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
valanga>=0.1.
|
|
2
|
-
atomheart>=0.1.
|
|
1
|
+
valanga>=0.1.14
|
|
2
|
+
atomheart>=0.1.7
|
|
3
3
|
rich
|
|
4
4
|
sortedcollections>=2.1.0
|
|
5
5
|
graphviz
|
|
@@ -15,15 +15,15 @@ sphinx-autodoc-typehints
|
|
|
15
15
|
pre-commit
|
|
16
16
|
|
|
17
17
|
[lint]
|
|
18
|
-
ruff>=0.
|
|
19
|
-
pylint>=
|
|
18
|
+
ruff>=0.15.0
|
|
19
|
+
pylint>=4.0.4
|
|
20
20
|
|
|
21
21
|
[nn]
|
|
22
22
|
algorhino-coral
|
|
23
23
|
torch
|
|
24
24
|
|
|
25
25
|
[test]
|
|
26
|
-
pytest>=
|
|
26
|
+
pytest>=9.0.2
|
|
27
27
|
coverage
|
|
28
28
|
pytest-cov>=6.0.0
|
|
29
29
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module provides functionality for creating tree and value builders for the TreeAndValuePlayer.
|
|
1
|
+
"""Provide functionality for creating tree and value builders for the TreeAndValuePlayer.
|
|
3
2
|
|
|
4
3
|
The TreeAndValuePlayerArgs class represents the arguments for configuring the TreeAndValuePlayer.
|
|
5
4
|
The create_tree_and_value_builders function is used to create the tree and value builders.
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Module for creating Tree and Value Branch Selector objects.
|
|
3
|
-
"""
|
|
1
|
+
"""Module for creating Tree and Value Branch Selector objects."""
|
|
4
2
|
|
|
5
3
|
from dataclasses import dataclass
|
|
6
|
-
from queue import Queue
|
|
7
4
|
from random import Random
|
|
8
|
-
from typing import Literal
|
|
5
|
+
from typing import Literal
|
|
9
6
|
|
|
10
7
|
from valanga import RepresentationFactory, StateModifications, TurnState
|
|
11
8
|
from valanga.evaluator_types import EvaluatorInput
|
|
@@ -26,7 +23,6 @@ from anemone.nodes.algorithm_node.algorithm_node import AlgorithmNode
|
|
|
26
23
|
from anemone.progress_monitor.progress_monitor import (
|
|
27
24
|
AllStoppingCriterionArgs,
|
|
28
25
|
)
|
|
29
|
-
from anemone.utils.dataclass import IsDataclass
|
|
30
26
|
|
|
31
27
|
from . import node_selector as node_selector_m
|
|
32
28
|
from . import recommender_rule
|
|
@@ -40,9 +36,7 @@ TREE_AND_VALUE_LITERAL_STRING: Literal["TreeAndValue"] = "TreeAndValue"
|
|
|
40
36
|
|
|
41
37
|
@dataclass
|
|
42
38
|
class TreeAndValuePlayerArgs:
|
|
43
|
-
"""
|
|
44
|
-
Dataclass for Tree and Value Player Arguments.
|
|
45
|
-
"""
|
|
39
|
+
"""Dataclass for Tree and Value Player Arguments."""
|
|
46
40
|
|
|
47
41
|
node_selector: node_selector_m.AllNodeSelectorArgs
|
|
48
42
|
opening_type: node_selector_m.OpeningType
|
|
@@ -53,7 +47,7 @@ class TreeAndValuePlayerArgs:
|
|
|
53
47
|
|
|
54
48
|
|
|
55
49
|
def create_tree_and_value_branch_selector[StateT: TurnState](
|
|
56
|
-
state_type:
|
|
50
|
+
state_type: type[StateT],
|
|
57
51
|
args: TreeAndValuePlayerArgs,
|
|
58
52
|
random_generator: Random,
|
|
59
53
|
master_state_evaluator: MasterStateEvaluator,
|
|
@@ -61,15 +55,13 @@ def create_tree_and_value_branch_selector[StateT: TurnState](
|
|
|
61
55
|
StateT, EvaluatorInput, StateModifications
|
|
62
56
|
]
|
|
63
57
|
| None,
|
|
64
|
-
queue_progress_player: Queue[IsDataclass] | None,
|
|
65
58
|
) -> TreeAndValueBranchSelector[StateT]:
|
|
66
|
-
"""
|
|
59
|
+
"""Create a branch selector using the default minmax tree evaluation.
|
|
67
60
|
|
|
68
61
|
This keeps the existing API stable, while allowing advanced users to inject a
|
|
69
62
|
different tree-evaluation strategy via
|
|
70
63
|
`create_tree_and_value_branch_selector_with_tree_eval_factory`.
|
|
71
64
|
"""
|
|
72
|
-
|
|
73
65
|
node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT]
|
|
74
66
|
node_tree_evaluation_factory = NodeTreeMinmaxEvaluationFactory[StateT]()
|
|
75
67
|
|
|
@@ -80,12 +72,11 @@ def create_tree_and_value_branch_selector[StateT: TurnState](
|
|
|
80
72
|
master_state_evaluator=master_state_evaluator,
|
|
81
73
|
state_representation_factory=state_representation_factory,
|
|
82
74
|
node_tree_evaluation_factory=node_tree_evaluation_factory,
|
|
83
|
-
queue_progress_player=queue_progress_player,
|
|
84
75
|
)
|
|
85
76
|
|
|
86
77
|
|
|
87
78
|
def create_tree_and_value_branch_selector_with_tree_eval_factory[StateT: TurnState](
|
|
88
|
-
state_type:
|
|
79
|
+
state_type: type[StateT],
|
|
89
80
|
args: TreeAndValuePlayerArgs,
|
|
90
81
|
random_generator: Random,
|
|
91
82
|
master_state_evaluator: MasterStateEvaluator,
|
|
@@ -94,21 +85,21 @@ def create_tree_and_value_branch_selector_with_tree_eval_factory[StateT: TurnSta
|
|
|
94
85
|
]
|
|
95
86
|
| None,
|
|
96
87
|
node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT],
|
|
97
|
-
queue_progress_player: Queue[IsDataclass] | None,
|
|
98
88
|
) -> TreeAndValueBranchSelector[StateT]:
|
|
99
|
-
"""
|
|
100
|
-
Create a TreeAndValueBranchSelector object with the given arguments.
|
|
89
|
+
"""Create a TreeAndValueBranchSelector object with the given arguments.
|
|
101
90
|
|
|
102
91
|
Args:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
random_generator (
|
|
92
|
+
state_type (type[StateT]): The state type for the search.
|
|
93
|
+
args (TreeAndValuePlayerArgs): Arguments for creating the selector.
|
|
94
|
+
random_generator (Random): The random number generator.
|
|
95
|
+
master_state_evaluator (MasterStateEvaluator): Evaluator for state values.
|
|
96
|
+
state_representation_factory (RepresentationFactory | None): Optional state representation factory.
|
|
97
|
+
node_tree_evaluation_factory (NodeTreeEvaluationFactory[StateT]): Factory for node tree evaluations.
|
|
106
98
|
|
|
107
99
|
Returns:
|
|
108
100
|
TreeAndValueBranchSelector: The created TreeAndValueBranchSelector object.
|
|
109
101
|
|
|
110
102
|
"""
|
|
111
|
-
|
|
112
103
|
_ = state_type # not used here
|
|
113
104
|
|
|
114
105
|
node_evaluator: NodeDirectEvaluator[StateT] = create_node_evaluator(
|
|
@@ -155,7 +146,6 @@ def create_tree_and_value_branch_selector_with_tree_eval_factory[StateT: TurnSta
|
|
|
155
146
|
node_selector_create=search_factory.create_node_selector_factory(),
|
|
156
147
|
stopping_criterion_args=args.stopping_criterion,
|
|
157
148
|
recommend_branch_after_exploration=args.recommender_rule,
|
|
158
|
-
queue_progress_player=queue_progress_player,
|
|
159
149
|
)
|
|
160
150
|
)
|
|
161
151
|
return tree_branch_selector
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Index utilities for node exploration and index management."""
|
{algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/__init__.py
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module provides functionality for managing exploration index managers.
|
|
1
|
+
"""Provide functionality for managing exploration index managers.
|
|
3
2
|
|
|
4
3
|
The module includes the following functions and classes:
|
|
5
4
|
- create_exploration_index_manager: A function to create an exploration index manager.
|
|
@@ -9,4 +8,4 @@ The module includes the following functions and classes:
|
|
|
9
8
|
from .factory import create_exploration_index_manager
|
|
10
9
|
from .node_exploration_manager import NodeExplorationIndexManager
|
|
11
10
|
|
|
12
|
-
__all__ = ["
|
|
11
|
+
__all__ = ["NodeExplorationIndexManager", "create_exploration_index_manager"]
|
{algorhino_anemone-0.1.10 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/factory.py
RENAMED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module contains the factory function to create a node exploration index manager based on the given index computation
|
|
3
|
-
"""
|
|
1
|
+
"""Provide a factory for node exploration index managers."""
|
|
4
2
|
|
|
5
3
|
from anemone.indices.index_manager.node_exploration_manager import (
|
|
6
4
|
NodeExplorationIndexManager,
|
|
@@ -14,11 +12,20 @@ from anemone.indices.node_indices.index_types import (
|
|
|
14
12
|
)
|
|
15
13
|
|
|
16
14
|
|
|
15
|
+
class UnknownIndexComputationError(ValueError):
|
|
16
|
+
"""Raised when an index computation type is not recognized."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, index_computation: IndexComputationType) -> None:
|
|
19
|
+
"""Initialize the error with the unsupported computation type."""
|
|
20
|
+
super().__init__(
|
|
21
|
+
f"player creator: can not find {index_computation} in {__name__}"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
17
25
|
def create_exploration_index_manager(
|
|
18
26
|
index_computation: IndexComputationType | None = None,
|
|
19
27
|
) -> NodeExplorationIndexManager:
|
|
20
|
-
"""
|
|
21
|
-
Creates a node exploration index manager based on the given index computation type.
|
|
28
|
+
"""Create a node exploration index manager for the given index computation type.
|
|
22
29
|
|
|
23
30
|
Args:
|
|
24
31
|
index_computation (IndexComputationType | None): The type of index computation to be used.
|
|
@@ -43,8 +50,6 @@ def create_exploration_index_manager(
|
|
|
43
50
|
case IndexComputationType.MIN_LOCAL_CHANGE:
|
|
44
51
|
node_exploration_manager = UpdateIndexLocalMinChange()
|
|
45
52
|
case _:
|
|
46
|
-
raise
|
|
47
|
-
f"player creator: can not find {index_computation} in {__name__}"
|
|
48
|
-
)
|
|
53
|
+
raise UnknownIndexComputationError(index_computation)
|
|
49
54
|
|
|
50
55
|
return node_exploration_manager
|