graph-games-proto 0.3.1831__py3-none-any.whl → 0.3.1864__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 +30 -19
- {graph_games_proto-0.3.1831.dist-info → graph_games_proto-0.3.1864.dist-info}/METADATA +1 -1
- {graph_games_proto-0.3.1831.dist-info → graph_games_proto-0.3.1864.dist-info}/RECORD +5 -5
- {graph_games_proto-0.3.1831.dist-info → graph_games_proto-0.3.1864.dist-info}/WHEEL +0 -0
- {graph_games_proto-0.3.1831.dist-info → graph_games_proto-0.3.1864.dist-info}/top_level.txt +0 -0
graph_games_proto/fns.py
CHANGED
@@ -3887,16 +3887,19 @@ def append_to_legal_actions(game, legal_action):
|
|
3887
3887
|
|
3888
3888
|
|
3889
3889
|
def default_accept_action(game, action):
|
3890
|
+
if not game or not action or not action.legal_action:
|
3891
|
+
return False
|
3892
|
+
|
3890
3893
|
# Returns true if action.legal_action is found in game.legal_actions_2
|
3891
3894
|
# The comparision is by value, not by reference
|
3892
|
-
if
|
3895
|
+
if action.legal_action not in game.legal_actions_2:
|
3893
3896
|
return False
|
3894
3897
|
|
3895
3898
|
# Check if "action.move_pieces_to_path" is not None
|
3896
3899
|
if action.move_pieces_to_path:
|
3897
3900
|
return is_move_pieces_to_path_action_legal(game, action)
|
3898
|
-
|
3899
|
-
return
|
3901
|
+
|
3902
|
+
return True
|
3900
3903
|
|
3901
3904
|
|
3902
3905
|
def is_move_pieces_to_path_action_legal(game, action):
|
@@ -3961,11 +3964,13 @@ def append_default_legal_actions_for_initial_player(game, action, log=False):
|
|
3961
3964
|
return result
|
3962
3965
|
|
3963
3966
|
except SyntaxError as e:
|
3964
|
-
|
3965
|
-
|
3967
|
+
msg = f"Syntax error in initialization hook: {str(e)}"
|
3968
|
+
logging.error(msg, exc_info=True)
|
3969
|
+
raise SyntaxError(msg) from e
|
3966
3970
|
except Exception as e:
|
3967
|
-
|
3968
|
-
|
3971
|
+
msg = f"Error in initialization hook: {str(e)}"
|
3972
|
+
logging.error(msg, exc_info=True)
|
3973
|
+
raise Exception(msg) from e
|
3969
3974
|
|
3970
3975
|
|
3971
3976
|
def append_default_legal_actions_for_next_player(game, action, log=False):
|
@@ -3995,11 +4000,13 @@ def append_default_legal_actions_for_next_player(game, action, log=False):
|
|
3995
4000
|
return result
|
3996
4001
|
|
3997
4002
|
except SyntaxError as e:
|
3998
|
-
|
3999
|
-
|
4003
|
+
msg = f"Syntax error in initialization hook: {str(e)}"
|
4004
|
+
logging.error(msg, exc_info=True)
|
4005
|
+
raise SyntaxError(msg) from e
|
4000
4006
|
except Exception as e:
|
4001
|
-
|
4002
|
-
|
4007
|
+
msg = f"Error in initialization hook: {str(e)}"
|
4008
|
+
logging.error(msg, exc_info=True)
|
4009
|
+
raise Exception(msg) from e
|
4003
4010
|
|
4004
4011
|
|
4005
4012
|
def get_total_path_count(game):
|
@@ -4336,11 +4343,13 @@ def run_state_action_hook(state, action, hook, log=False):
|
|
4336
4343
|
return result
|
4337
4344
|
|
4338
4345
|
except SyntaxError as e:
|
4339
|
-
|
4340
|
-
|
4346
|
+
msg = f"Syntax error in initialization hook {hook.uuid}: {str(e)}"
|
4347
|
+
logging.error(msg, exc_info=True)
|
4348
|
+
raise SyntaxError(msg) from e
|
4341
4349
|
except Exception as e:
|
4342
|
-
|
4343
|
-
|
4350
|
+
msg = f"Error in initialization hook {hook.uuid}: {str(e)}"
|
4351
|
+
logging.error(msg, exc_info=True)
|
4352
|
+
raise Exception(msg) from e
|
4344
4353
|
|
4345
4354
|
|
4346
4355
|
def run_state_hook(state, hook, log=False):
|
@@ -4365,11 +4374,13 @@ def run_state_hook(state, hook, log=False):
|
|
4365
4374
|
return result
|
4366
4375
|
|
4367
4376
|
except SyntaxError as e:
|
4368
|
-
|
4369
|
-
|
4377
|
+
msg = f"Syntax error in initialization hook {hook.uuid}: {str(e)}"
|
4378
|
+
logging.error(msg, exc_info=True)
|
4379
|
+
raise SyntaxError(msg) from e
|
4370
4380
|
except Exception as e:
|
4371
|
-
|
4372
|
-
|
4381
|
+
msg = f"Error in initialization hook {hook.uuid}: {str(e)}"
|
4382
|
+
logging.error(msg, exc_info=True)
|
4383
|
+
raise Exception(msg) from e
|
4373
4384
|
|
4374
4385
|
|
4375
4386
|
# Implementing the following Julia function:
|
@@ -1,9 +1,9 @@
|
|
1
1
|
graph_games_proto/__init__.py,sha256=O5XjRfe3DlxbJn4zezDvvy7cXvL4IzIRPZCL3Y-n7s8,776
|
2
2
|
graph_games_proto/all_types.py,sha256=IpbwftEcHS5Ewz-saFNk0lO9FvcbuHG36odRTayCXUk,54911
|
3
|
-
graph_games_proto/fns.py,sha256=
|
3
|
+
graph_games_proto/fns.py,sha256=PosUF9Gr77oZzIaEpfhJteapz6te67HhrbwXWhxgo20,242399
|
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.
|
7
|
-
graph_games_proto-0.3.
|
8
|
-
graph_games_proto-0.3.
|
9
|
-
graph_games_proto-0.3.
|
6
|
+
graph_games_proto-0.3.1864.dist-info/METADATA,sha256=2-OMsPvMLX071_QjZDvVDm8yKWj7NlSwB_Agv14gPtY,188
|
7
|
+
graph_games_proto-0.3.1864.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
graph_games_proto-0.3.1864.dist-info/top_level.txt,sha256=-4QSrBMf_MM4BGsr2QXBpqDx8c8k_OPnzGyFjqjakes,18
|
9
|
+
graph_games_proto-0.3.1864.dist-info/RECORD,,
|
File without changes
|
File without changes
|