valanga 0.1.10__py3-none-any.whl → 0.1.13__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.
valanga/policy.py CHANGED
@@ -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(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: State, 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.10
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
@@ -3,13 +3,13 @@ valanga/evaluations.py,sha256=kGq8oU6cV-dlMvX_lSU_AAAWCXlvEGhsXdRt_CmuYvc,1461
3
3
  valanga/evaluator_types.py,sha256=dRNY297Up2BSIM2557jy6cz0cINzfUHOpqkr1T6SSQM,344
4
4
  valanga/game.py,sha256=7vFLJL0AhG9EqG_Po0hpyFU685YVMWnKYXn-QR2yiOo,6086
5
5
  valanga/over_event.py,sha256=jUqN3CXq3e55TvDZatZKFlEOzJfho7M1Zr7VjZUhP6M,7908
6
- valanga/policy.py,sha256=TkqcOSePRhHqtuoMbCKe5qZbizvF5H9uG1_oEcIZsuA,1229
6
+ valanga/policy.py,sha256=3WnxrRREDUvf2tAawSxvZus-x-d77ukhd2P3oIaFKUA,1337
7
7
  valanga/progress_messsage.py,sha256=3LnOXSgyU84UkwcpsakcbPt_d3el2ojRSUClAwoPyEk,361
8
8
  valanga/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  valanga/representation_factory.py,sha256=bVG3i3jBqI6vvvbsoBroYUw7gno7Xeu8vkxPmNCooHE,2464
10
10
  valanga/represention_for_evaluation.py,sha256=9yCCOuN-h9FnoLJrffKGQ-oXiiXzZT3rP4e5wwMYfys,1135
11
- valanga-0.1.10.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
12
- valanga-0.1.10.dist-info/METADATA,sha256=zIjR8yznAxq7VEr51hQWIDiCrm_-Mo89StrdaabHVpo,44646
13
- valanga-0.1.10.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
14
- valanga-0.1.10.dist-info/top_level.txt,sha256=cKFLhxKDTqygHnc0xc_L8jDx6oNu5hSHqZ4UExU4xPo,8
15
- valanga-0.1.10.dist-info/RECORD,,
11
+ valanga-0.1.13.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
12
+ valanga-0.1.13.dist-info/METADATA,sha256=x9QpOaUJRiVcrIYiRQZdi71cbE4Kb-qH99MXi38WdTc,44646
13
+ valanga-0.1.13.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
14
+ valanga-0.1.13.dist-info/top_level.txt,sha256=cKFLhxKDTqygHnc0xc_L8jDx6oNu5hSHqZ4UExU4xPo,8
15
+ valanga-0.1.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5