graph-games-proto 0.3.1917__py3-none-any.whl → 0.3.1918__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.
graph_games_proto/fns.py CHANGED
@@ -1942,9 +1942,7 @@ class StateKernal(PClass):
1942
1942
  player_idxs = field(type=list) # List[int]
1943
1943
  history = field(type=list) # List[PublicAction]
1944
1944
  player_scores = field(type=list) # List[PlayerScore]
1945
- uuid2edge = field(type=dict) # Dict[str, BiEdge]
1946
1945
  idx2path = field(type=list) # List[Path2]
1947
- uuid2segment = field(type=dict) # Dict[str, Segment]
1948
1946
  pieceuuid2piece = field(type=dict) # Dict[str, Piece]
1949
1947
  edgeuuid2idx = field(type=dict) # Dict[str, int]
1950
1948
  carduuid2card = field(type=dict) # Dict[str, Card]
@@ -1959,9 +1957,7 @@ class StateKernal(PClass):
1959
1957
  "player_idxs": self.player_idxs,
1960
1958
  "history": [action.__todict__() for action in self.history],
1961
1959
  "player_scores": [score.__todict__() for score in self.player_scores],
1962
- "uuid2edge": {k: v.__todict() for k, v in self.uuid2edge.items()},
1963
1960
  "idx2path": [v.__todict__() for v in self.idx2path],
1964
- "uuid2segment": {k: v.__todict__() for k, v in self.uuid2segment.items()},
1965
1961
  "pieceuuid2piece": {k: v.__todict__() for k, v in self.pieceuuid2piece.items()},
1966
1962
  "edgeuuid2idx": self.edgeuuid2idx,
1967
1963
  "carduuid2card": {k: v.__todict__() for k, v in self.carduuid2card.items()},
@@ -1978,9 +1974,7 @@ class StateKernal(PClass):
1978
1974
  player_idxs=d["player_idxs"],
1979
1975
  history=[PublicAction.__fromdict__(action) for action in d["history"]],
1980
1976
  player_scores=[PlayerScore.__fromdict__(score) for score in d["player_scores"]],
1981
- uuid2edge={k: BiEdge.__fromdict(v) for k, v in d["uuid2edge"].items()},
1982
1977
  idx2path=[Path2.__fromdict(v) for v in d["idx2path"]],
1983
- uuid2segment={k: Segment2.__fromdict(v) for k, v in d["uuid2segment"].items()},
1984
1978
  pieceuuid2piece={k: Piece.__fromdict(v) for k, v in d["pieceuuid2piece"].items()},
1985
1979
  edgeuuid2idx=d["edgeuuid2idx"],
1986
1980
  carduuid2card={k: Card.__fromdict(v) for k, v in d["carduuid2card"].items()},
@@ -1992,16 +1986,11 @@ def init_state_kernal(**kwargs):
1992
1986
  fig = game_config.fig
1993
1987
  board_config = fig.board_config
1994
1988
  edges = kwargs.get('edges', [])
1995
- uuid2edge = {}
1996
1989
  idx2path = []
1997
- uuid2segment = {}
1998
1990
  edgeuuid2idx = {edge.uuid: idx for idx, edge in enumerate(edges)}
1999
1991
  for edge in edges:
2000
- uuid2edge[edge.uuid] = edge
2001
1992
  for path in edge.paths:
2002
1993
  idx2path.append(path)
2003
- for segment in path.segments:
2004
- uuid2segment[segment.uuid] = segment
2005
1994
  pieceuuid2piece = {}
2006
1995
  for piece_template in board_config.piece_templates:
2007
1996
  if piece_template.has_player:
@@ -2025,9 +2014,7 @@ def init_state_kernal(**kwargs):
2025
2014
  player_idxs=kwargs.get('player_idxs'),
2026
2015
  history=kwargs.get('history'),
2027
2016
  player_scores=kwargs.get('player_scores'),
2028
- uuid2edge=uuid2edge,
2029
2017
  idx2path=idx2path,
2030
- uuid2segment=uuid2segment,
2031
2018
  edgeuuid2idx=edgeuuid2idx,
2032
2019
  carduuid2card=carduuid2card,
2033
2020
  pieceuuid2piece=pieceuuid2piece,
@@ -2036,9 +2023,7 @@ def init_state_kernal(**kwargs):
2036
2023
 
2037
2024
  class State(PClass):
2038
2025
  kernal = field(type=StateKernal)
2039
- uuid2edge = field(type=dict) # Dict[str, BiEdge]
2040
2026
  idx2path = field(type=list) # List[Path2]
2041
- uuid2segment = field(type=dict) # Dict[str, Segment]
2042
2027
  pieceuuid2piece = field(type=dict) # Dict[str, Piece]
2043
2028
  carduuid2card = field(type=dict) # Dict[str, Card]
2044
2029
  bonus_statuses = field(type=list) # List[BonusStatus]
@@ -2068,9 +2053,7 @@ class State(PClass):
2068
2053
  def __todict__(self):
2069
2054
  return {
2070
2055
  "kernal": self.kernal.__todict__(),
2071
- "uuid2edge": {k: v.__todict__() for k, v in self.uuid2edge.items()},
2072
2056
  "idx2path": [v.__todict__() for v in self.idx2path],
2073
- "uuid2segment": {k: v.__todict__() for k, v in self.uuid2segment.items()},
2074
2057
  "pieceuuid2piece": {k: v.__todict__() for k, v in self.pieceuuid2piece.items()},
2075
2058
  "carduuid2card": {k: v.__todict__() for k, v in self.carduuid2card.items()},
2076
2059
  "bonus_statuses": [status.__todict__() for status in self.bonus_statuses],
@@ -2102,9 +2085,7 @@ class State(PClass):
2102
2085
  def __fromdict__(d):
2103
2086
  return State(
2104
2087
  kernal=StateKernal.__fromdict__(d["kernal"]),
2105
- uuid2edge={k: BiEdge.__fromdict__(v) for k, v in d["uuid2edge"].items()},
2106
2088
  idx2path=[Path2.__fromdict__(v) for v in d["idx2path"]],
2107
- uuid2segment={k: Segment2.__fromdict__(v) for k, v in d["uuid2segment"].items()},
2108
2089
  pieceuuid2piece={k: Piece.__fromdict__(v) for k, v in d["pieceuuid2piece"].items()},
2109
2090
  carduuid2card={k: Card.__fromdict__(v) for k, v in d["carduuid2card"].items()},
2110
2091
  bonus_statuses=[BonusStatus.__fromdict__(x) for x in d["bonus_statuses"]],
@@ -2638,17 +2619,11 @@ def getinitialstate(game_config):
2638
2619
  edge_tuple = (min(node_1_idx, node_2_idx), max(node_1_idx, node_2_idx))
2639
2620
  edgetuple2uuid[edge_tuple] = edge.uuid
2640
2621
 
2641
-
2642
- uuid2edge = {}
2643
2622
  idx2path = []
2644
- uuid2segment = {}
2645
2623
 
2646
2624
  for edge in edges:
2647
- uuid2edge[edge.uuid] = edge
2648
2625
  for path in edge.paths:
2649
2626
  idx2path.append(path)
2650
- for segment in path.segments:
2651
- uuid2segment[segment.uuid] = segment
2652
2627
 
2653
2628
  bonuses = game_config.fig.board_config.bonuses
2654
2629
  bonusuuid2bonusidx = {bonus.uuid: idx for idx, bonus in enumerate(bonuses)}
@@ -2669,9 +2644,7 @@ def getinitialstate(game_config):
2669
2644
  ]
2670
2645
 
2671
2646
  state = State(
2672
- uuid2edge=uuid2edge,
2673
2647
  idx2path=idx2path,
2674
- uuid2segment=uuid2segment,
2675
2648
  pieceuuid2piece=pieceuuid2piece,
2676
2649
  carduuid2card=carduuid2card,
2677
2650
  bonus_statuses=bonus_statuses,
@@ -4262,9 +4235,7 @@ def init_state(kernal):
4262
4235
  player_scores=kernal.player_scores,
4263
4236
  legal_actions_3=[],
4264
4237
  is_terminal=False,
4265
- uuid2edge=kernal.uuid2edge,
4266
4238
  idx2path=kernal.idx2path,
4267
- uuid2segment=kernal.uuid2segment,
4268
4239
  pieceuuid2piece=kernal.pieceuuid2piece,
4269
4240
  edgeuuid2idx=kernal.edgeuuid2idx,
4270
4241
  carduuid2card=kernal.carduuid2card,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graph_games_proto
3
- Version: 0.3.1917
3
+ Version: 0.3.1918
4
4
  Requires-Dist: multipledispatch==1.0.0
5
5
  Requires-Dist: pyrsistent==0.20.0
6
6
  Requires-Dist: numpy==2.2.4
@@ -1,9 +1,9 @@
1
1
  graph_games_proto/__init__.py,sha256=_EVQR-51XehfH45XZlba1WPdx3omS3Gm1nTwrgGyn2Q,667
2
2
  graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
3
- graph_games_proto/fns.py,sha256=yH7roM_wtAdsgFfeQA8wahPykXQrdCoySKm3f8U5Diw,193316
3
+ graph_games_proto/fns.py,sha256=tlnr9TsZohGevs4lUqAPaF7qPknJWnzH_jmEpiEKITc,191851
4
4
  graph_games_proto/main.py,sha256=fj2U7KcwrpZtuUhjOX5yVxY18LZvvsxDFYZ_S5mxe04,145
5
5
  graph_games_proto/state.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- graph_games_proto-0.3.1917.dist-info/METADATA,sha256=Nzsbrk3Z0TxOO5hmViO9MlS4_Lw-kTunuJoJiB3N9FU,188
7
- graph_games_proto-0.3.1917.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- graph_games_proto-0.3.1917.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
- graph_games_proto-0.3.1917.dist-info/RECORD,,
6
+ graph_games_proto-0.3.1918.dist-info/METADATA,sha256=NpjVzxy7lmO0xpfAdfDo4G-bVCE-cbsPXrvvRd9M_cQ,188
7
+ graph_games_proto-0.3.1918.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
+ graph_games_proto-0.3.1918.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
9
+ graph_games_proto-0.3.1918.dist-info/RECORD,,