valanga 0.1.6__tar.gz → 0.1.7__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.6 → valanga-0.1.7}/PKG-INFO +1 -1
  2. {valanga-0.1.6 → valanga-0.1.7}/pyproject.toml +1 -1
  3. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/representation_factory.py +26 -12
  4. {valanga-0.1.6 → valanga-0.1.7}/src/valanga.egg-info/PKG-INFO +1 -1
  5. {valanga-0.1.6 → valanga-0.1.7}/LICENSE +0 -0
  6. {valanga-0.1.6 → valanga-0.1.7}/README.md +0 -0
  7. {valanga-0.1.6 → valanga-0.1.7}/setup.cfg +0 -0
  8. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/__init__.py +0 -0
  9. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/evaluations.py +0 -0
  10. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/evaluator_types.py +0 -0
  11. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/game.py +0 -0
  12. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/over_event.py +0 -0
  13. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/policy.py +0 -0
  14. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/progress_messsage.py +0 -0
  15. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/py.typed +0 -0
  16. {valanga-0.1.6 → valanga-0.1.7}/src/valanga/represention_for_evaluation.py +0 -0
  17. {valanga-0.1.6 → valanga-0.1.7}/src/valanga.egg-info/SOURCES.txt +0 -0
  18. {valanga-0.1.6 → valanga-0.1.7}/src/valanga.egg-info/dependency_links.txt +0 -0
  19. {valanga-0.1.6 → valanga-0.1.7}/src/valanga.egg-info/requires.txt +0 -0
  20. {valanga-0.1.6 → valanga-0.1.7}/src/valanga.egg-info/top_level.txt +0 -0
  21. {valanga-0.1.6 → valanga-0.1.7}/tests/test_over_event.py +0 -0
  22. {valanga-0.1.6 → valanga-0.1.7}/tests/test_placeholder.py +0 -0
  23. {valanga-0.1.6 → valanga-0.1.7}/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.6
3
+ Version: 0.1.7
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.6"
7
+ version = "0.1.7"
8
8
  description = "Shared types and utilities for evaluation"
9
9
  requires-python = ">=3.13"
10
10
  dependencies = []
@@ -3,23 +3,35 @@ Factory for creating content representations from game states and state modifica
3
3
  """
4
4
 
5
5
  from dataclasses import dataclass
6
- from typing import Callable, TypeVar
6
+ from typing import Protocol
7
7
 
8
- from .game import State, StateModifications
8
+ from .game import State
9
9
  from .represention_for_evaluation import ContentRepresentation
10
10
 
11
- StateT = TypeVar("StateT", bound=State)
12
- EvalIn = TypeVar("EvalIn")
13
11
 
14
- CreateFromState = Callable[[StateT], ContentRepresentation[StateT, EvalIn]]
15
- CreateFromStateAndMods = Callable[
16
- [StateT, StateModifications, ContentRepresentation[StateT, EvalIn]],
17
- ContentRepresentation[StateT, EvalIn],
18
- ]
12
+ class CreateFromState[StateT: State, EvalIn](Protocol):
13
+ """
14
+ Protocol for creating a state representation from a state.
15
+ """
16
+
17
+ def __call__(self, state: StateT) -> ContentRepresentation[StateT, EvalIn]: ...
18
+
19
+
20
+ class CreateFromStateAndModifications[StateT: State, EvalIn, StateModT](Protocol):
21
+ """
22
+ Protocol for creating a state representation from a state and modifications.
23
+ """
24
+
25
+ def __call__(
26
+ self,
27
+ state: StateT,
28
+ state_modifications: StateModT,
29
+ previous_state_representation: ContentRepresentation[StateT, EvalIn],
30
+ ) -> ContentRepresentation[StateT, EvalIn]: ...
19
31
 
20
32
 
21
33
  @dataclass
22
- class RepresentationFactory[StateT: State, EvalIn]:
34
+ class RepresentationFactory[StateT: State, EvalIn, StateModT]:
23
35
  """Factory for creating content representations from states and state modifications.
24
36
  Attributes:
25
37
  create_from_state: Function to create a content representation from a state.
@@ -27,13 +39,15 @@ class RepresentationFactory[StateT: State, EvalIn]:
27
39
  """
28
40
 
29
41
  create_from_state: CreateFromState[StateT, EvalIn]
30
- create_from_state_and_modifications: CreateFromStateAndMods[StateT, EvalIn]
42
+ create_from_state_and_modifications: CreateFromStateAndModifications[
43
+ StateT, EvalIn, StateModT
44
+ ]
31
45
 
32
46
  def create_from_transition(
33
47
  self,
34
48
  state: StateT,
35
49
  previous_state_representation: ContentRepresentation[StateT, EvalIn] | None,
36
- modifications: StateModifications | None,
50
+ modifications: StateModT | None,
37
51
  ) -> ContentRepresentation[StateT, EvalIn]:
38
52
  """Creates a content representation from a state transition.
39
53
  Args:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: valanga
3
- Version: 0.1.6
3
+ Version: 0.1.7
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
File without changes
File without changes