algorhino-anemone 0.1.9__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.
Files changed (93) hide show
  1. {algorhino_anemone-0.1.9/src/algorhino_anemone.egg-info → algorhino_anemone-0.1.11}/PKG-INFO +6 -6
  2. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/pyproject.toml +25 -17
  3. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11/src/algorhino_anemone.egg-info}/PKG-INFO +6 -6
  4. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/requires.txt +5 -5
  5. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/__init__.py +1 -2
  6. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/factory.py +16 -30
  7. algorhino_anemone-0.1.11/src/anemone/indices/__init__.py +1 -0
  8. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/__init__.py +2 -3
  9. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/factory.py +13 -8
  10. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/indices/index_manager/node_exploration_manager.py +60 -55
  11. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/__init__.py +2 -3
  12. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/factory.py +16 -14
  13. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/index_data.py +20 -24
  14. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/indices/node_indices/index_types.py +5 -7
  15. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nn/torch_evaluator.py +18 -11
  16. algorhino_anemone-0.1.11/src/anemone/node_evaluation/__init__.py +1 -0
  17. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_direct_evaluation/__init__.py +2 -3
  18. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_direct_evaluation/factory.py +1 -1
  19. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_direct_evaluation/node_direct_evaluator.py +19 -42
  20. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_tree_evaluation/node_minmax_evaluation.py +113 -115
  21. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation.py +11 -8
  22. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_evaluation/node_tree_evaluation/node_tree_evaluation_factory.py +5 -5
  23. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_factory/__init__.py +2 -3
  24. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_factory/algorithm_node_factory.py +4 -9
  25. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_factory/base.py +5 -12
  26. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/__init__.py +5 -6
  27. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/branch_explorer.py +18 -21
  28. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/factory.py +16 -16
  29. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/node_selector.py +6 -12
  30. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/node_selector_args.py +2 -5
  31. algorhino_anemone-0.1.11/src/anemone/node_selector/node_selector_types.py +11 -0
  32. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/notations_and_statics.py +4 -10
  33. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/opening_instructions.py +37 -57
  34. algorhino_anemone-0.1.11/src/anemone/node_selector/recurzipf/__init__.py +1 -0
  35. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/recurzipf/recur_zipf_base.py +14 -42
  36. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/sequool/__init__.py +2 -3
  37. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/sequool/factory.py +3 -8
  38. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/sequool/sequool.py +32 -50
  39. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/uniform/__init__.py +1 -2
  40. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/node_selector/uniform/uniform.py +10 -18
  41. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nodes/__init__.py +2 -3
  42. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nodes/algorithm_node/__init__.py +1 -3
  43. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nodes/algorithm_node/algorithm_node.py +35 -37
  44. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nodes/itree_node.py +25 -31
  45. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nodes/tree_node.py +30 -29
  46. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nodes/tree_traversal.py +10 -11
  47. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/nodes/utils.py +14 -13
  48. algorhino_anemone-0.1.11/src/anemone/progress_monitor/__init__.py +1 -0
  49. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/progress_monitor/progress_monitor.py +55 -75
  50. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/recommender_rule/__init__.py +1 -2
  51. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/recommender_rule/recommender_rule.py +7 -16
  52. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/search_factory/__init__.py +2 -3
  53. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/search_factory/search_factory.py +25 -28
  54. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/tree_and_value_branch_selector.py +26 -19
  55. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/tree_exploration.py +30 -41
  56. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/__init__.py +3 -4
  57. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/algorithm_node_tree_manager.py +15 -29
  58. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/factory.py +3 -5
  59. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/tree_expander.py +13 -15
  60. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/tree_manager/tree_manager.py +14 -25
  61. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/trees/__init__.py +3 -5
  62. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/trees/descendants.py +80 -115
  63. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/trees/factory.py +9 -13
  64. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/trees/tree.py +8 -11
  65. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/trees/tree_visualization.py +10 -10
  66. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/__init__.py +4 -5
  67. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/algorithm_node_updater.py +11 -13
  68. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/factory.py +2 -4
  69. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/index_block.py +13 -14
  70. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/index_updater.py +7 -12
  71. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/minmax_evaluation_updater.py +7 -12
  72. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/updates_file.py +27 -26
  73. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/updates/value_block.py +10 -10
  74. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/utils/comparable.py +3 -4
  75. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/utils/dataclass.py +10 -13
  76. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/utils/dict_of_numbered_dict_with_pointer_on_max.py +16 -23
  77. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/utils/logger.py +13 -12
  78. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/utils/my_value_sorted_dict.py +4 -7
  79. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/utils/small_tools.py +16 -18
  80. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/tests/test_indices.py +8 -11
  81. algorhino_anemone-0.1.9/src/anemone/indices/__init__.py +0 -0
  82. algorhino_anemone-0.1.9/src/anemone/node_evaluation/__init__.py +0 -0
  83. algorhino_anemone-0.1.9/src/anemone/node_selector/node_selector_types.py +0 -15
  84. algorhino_anemone-0.1.9/src/anemone/node_selector/recurzipf/__init__.py +0 -0
  85. algorhino_anemone-0.1.9/src/anemone/progress_monitor/__init__.py +0 -0
  86. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/LICENSE +0 -0
  87. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/README.md +0 -0
  88. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/setup.cfg +0 -0
  89. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/SOURCES.txt +0 -0
  90. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/dependency_links.txt +0 -0
  91. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/algorhino_anemone.egg-info/top_level.txt +0 -0
  92. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/basics.py +0 -0
  93. {algorhino_anemone-0.1.9 → algorhino_anemone-0.1.11}/src/anemone/state_transition.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: algorhino-anemone
3
- Version: 0.1.9
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.10
16
- Requires-Dist: atomheart>=0.1.2
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>=8.4.1; extra == "test"
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.14.1; extra == "lint"
26
- Requires-Dist: pylint>=3.3.8; extra == "lint"
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.9.0"]
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.9"
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.10",
18
- "atomheart>=0.1.2",
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>=8.4.1",
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.14.1",
42
- "pylint>=3.3.8",
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"] # I = imports, F = pyflakes, E = pycodestyle, TCH = type-checking, B = black
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.10",
269
- "atomheart>=0.1.2",
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.14.1",
276
- "pylint>=3.3.8",
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", "tests"],
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.10",
294
- "atomheart>=0.1.2",
301
+ "valanga>=0.1.14",
302
+ "atomheart>=0.1.7",
295
303
  "rich",
296
304
  "sortedcollections>=2.1.0",
297
305
  "graphviz",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: algorhino-anemone
3
- Version: 0.1.9
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.10
16
- Requires-Dist: atomheart>=0.1.2
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>=8.4.1; extra == "test"
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.14.1; extra == "lint"
26
- Requires-Dist: pylint>=3.3.8; extra == "lint"
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,5 +1,5 @@
1
- valanga>=0.1.10
2
- atomheart>=0.1.2
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.14.1
19
- pylint>=3.3.8
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>=8.4.1
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,17 +1,10 @@
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, Type
5
+ from typing import Literal
9
6
 
10
- from valanga import (
11
- RepresentationFactory,
12
- StateModifications,
13
- TurnState,
14
- )
7
+ from valanga import RepresentationFactory, StateModifications, TurnState
15
8
  from valanga.evaluator_types import EvaluatorInput
16
9
 
17
10
  from anemone import node_factory
@@ -30,7 +23,6 @@ from anemone.nodes.algorithm_node.algorithm_node import AlgorithmNode
30
23
  from anemone.progress_monitor.progress_monitor import (
31
24
  AllStoppingCriterionArgs,
32
25
  )
33
- from anemone.utils.dataclass import IsDataclass
34
26
 
35
27
  from . import node_selector as node_selector_m
36
28
  from . import recommender_rule
@@ -44,9 +36,7 @@ TREE_AND_VALUE_LITERAL_STRING: Literal["TreeAndValue"] = "TreeAndValue"
44
36
 
45
37
  @dataclass
46
38
  class TreeAndValuePlayerArgs:
47
- """
48
- Dataclass for Tree and Value Player Arguments.
49
- """
39
+ """Dataclass for Tree and Value Player Arguments."""
50
40
 
51
41
  node_selector: node_selector_m.AllNodeSelectorArgs
52
42
  opening_type: node_selector_m.OpeningType
@@ -57,23 +47,21 @@ class TreeAndValuePlayerArgs:
57
47
 
58
48
 
59
49
  def create_tree_and_value_branch_selector[StateT: TurnState](
60
- state_type: Type[StateT],
50
+ state_type: type[StateT],
61
51
  args: TreeAndValuePlayerArgs,
62
52
  random_generator: Random,
63
53
  master_state_evaluator: MasterStateEvaluator,
64
54
  state_representation_factory: RepresentationFactory[
65
- StateT, StateModifications, EvaluatorInput
55
+ StateT, EvaluatorInput, StateModifications
66
56
  ]
67
57
  | None,
68
- queue_progress_player: Queue[IsDataclass] | None,
69
58
  ) -> TreeAndValueBranchSelector[StateT]:
70
- """Convenience constructor using the default minmax tree evaluation.
59
+ """Create a branch selector using the default minmax tree evaluation.
71
60
 
72
61
  This keeps the existing API stable, while allowing advanced users to inject a
73
62
  different tree-evaluation strategy via
74
63
  `create_tree_and_value_branch_selector_with_tree_eval_factory`.
75
64
  """
76
-
77
65
  node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT]
78
66
  node_tree_evaluation_factory = NodeTreeMinmaxEvaluationFactory[StateT]()
79
67
 
@@ -84,35 +72,34 @@ def create_tree_and_value_branch_selector[StateT: TurnState](
84
72
  master_state_evaluator=master_state_evaluator,
85
73
  state_representation_factory=state_representation_factory,
86
74
  node_tree_evaluation_factory=node_tree_evaluation_factory,
87
- queue_progress_player=queue_progress_player,
88
75
  )
89
76
 
90
77
 
91
78
  def create_tree_and_value_branch_selector_with_tree_eval_factory[StateT: TurnState](
92
- state_type: Type[StateT],
79
+ state_type: type[StateT],
93
80
  args: TreeAndValuePlayerArgs,
94
81
  random_generator: Random,
95
82
  master_state_evaluator: MasterStateEvaluator,
96
83
  state_representation_factory: RepresentationFactory[
97
- StateT, StateModifications, EvaluatorInput
84
+ StateT, EvaluatorInput, StateModifications
98
85
  ]
99
86
  | None,
100
87
  node_tree_evaluation_factory: NodeTreeEvaluationFactory[StateT],
101
- queue_progress_player: Queue[IsDataclass] | None,
102
88
  ) -> TreeAndValueBranchSelector[StateT]:
103
- """
104
- Create a TreeAndValueBranchSelector object with the given arguments.
89
+ """Create a TreeAndValueBranchSelector object with the given arguments.
105
90
 
106
91
  Args:
107
- args (TreeAndValuePlayerArgs): The arguments for creating the TreeAndValueBranchSelector.
108
- syzygy (SyzygyTable | None): The SyzygyTable object for tablebase endgame evaluation.
109
- random_generator (random.Random): The random number 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.
110
98
 
111
99
  Returns:
112
100
  TreeAndValueBranchSelector: The created TreeAndValueBranchSelector object.
113
101
 
114
102
  """
115
-
116
103
  _ = state_type # not used here
117
104
 
118
105
  node_evaluator: NodeDirectEvaluator[StateT] = create_node_evaluator(
@@ -159,7 +146,6 @@ def create_tree_and_value_branch_selector_with_tree_eval_factory[StateT: TurnSta
159
146
  node_selector_create=search_factory.create_node_selector_factory(),
160
147
  stopping_criterion_args=args.stopping_criterion,
161
148
  recommend_branch_after_exploration=args.recommender_rule,
162
- queue_progress_player=queue_progress_player,
163
149
  )
164
150
  )
165
151
  return tree_branch_selector
@@ -0,0 +1 @@
1
+ """Index utilities for node exploration and index management."""
@@ -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__ = ["create_exploration_index_manager", "NodeExplorationIndexManager"]
11
+ __all__ = ["NodeExplorationIndexManager", "create_exploration_index_manager"]
@@ -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 ValueError(
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