valanga 0.1.11__tar.gz → 0.1.13__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 (23) hide show
  1. {valanga-0.1.11 → valanga-0.1.13}/PKG-INFO +1 -1
  2. {valanga-0.1.11 → valanga-0.1.13}/pyproject.toml +1 -1
  3. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/policy.py +6 -3
  4. {valanga-0.1.11 → valanga-0.1.13}/src/valanga.egg-info/PKG-INFO +1 -1
  5. {valanga-0.1.11 → valanga-0.1.13}/LICENSE +0 -0
  6. {valanga-0.1.11 → valanga-0.1.13}/README.md +0 -0
  7. {valanga-0.1.11 → valanga-0.1.13}/setup.cfg +0 -0
  8. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/__init__.py +0 -0
  9. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/evaluations.py +0 -0
  10. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/evaluator_types.py +0 -0
  11. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/game.py +0 -0
  12. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/over_event.py +0 -0
  13. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/progress_messsage.py +0 -0
  14. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/py.typed +0 -0
  15. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/representation_factory.py +0 -0
  16. {valanga-0.1.11 → valanga-0.1.13}/src/valanga/represention_for_evaluation.py +0 -0
  17. {valanga-0.1.11 → valanga-0.1.13}/src/valanga.egg-info/SOURCES.txt +0 -0
  18. {valanga-0.1.11 → valanga-0.1.13}/src/valanga.egg-info/dependency_links.txt +0 -0
  19. {valanga-0.1.11 → valanga-0.1.13}/src/valanga.egg-info/requires.txt +0 -0
  20. {valanga-0.1.11 → valanga-0.1.13}/src/valanga.egg-info/top_level.txt +0 -0
  21. {valanga-0.1.11 → valanga-0.1.13}/tests/test_over_event.py +0 -0
  22. {valanga-0.1.11 → valanga-0.1.13}/tests/test_placeholder.py +0 -0
  23. {valanga-0.1.11 → valanga-0.1.13}/tests/test_representation_factory.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: valanga
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: Shared types and utilities for evaluation
5
5
  Author-email: Victor Gabillon <victorgabillon@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "valanga"
7
- version = "0.1.11"
7
+ version = "0.1.13"
8
8
  description = "Shared types and utilities for evaluation"
9
9
  requires-python = ">=3.13"
10
10
  dependencies = []
@@ -3,7 +3,7 @@ Policy-related classes and protocols for branch selection in game trees.
3
3
  """
4
4
 
5
5
  from dataclasses import dataclass
6
- from typing import Mapping, Protocol
6
+ from typing import Mapping, Protocol, TypeVar
7
7
 
8
8
  from valanga.evaluations import StateEvaluation
9
9
  from valanga.game import BranchKey, BranchName, Seed, State
@@ -28,10 +28,13 @@ class Recommendation:
28
28
  branch_evals: Mapping[BranchName, StateEvaluation] | None = None
29
29
 
30
30
 
31
- class BranchSelector[StateT: State](Protocol):
31
+ StateT_contra = TypeVar("StateT_contra", bound=State, contravariant=True)
32
+
33
+
34
+ class BranchSelector(Protocol[StateT_contra]):
32
35
  """Protocol for a branch selector."""
33
36
 
34
- def recommend(self, state: StateT, seed: Seed) -> Recommendation:
37
+ def recommend(self, state: StateT_contra, seed: Seed) -> Recommendation:
35
38
  """Given a state and a seed, recommends a branch to take.
36
39
  Args:
37
40
  state (State): The current state of the game.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: valanga
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: Shared types and utilities for evaluation
5
5
  Author-email: Victor Gabillon <victorgabillon@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
File without changes
File without changes
File without changes
File without changes
File without changes