ancient chinese+black

This commit is contained in:
Sander Land committed 2021-01-05 17:23:23 +01:00
1 parent fa12547dcb
commit edd2c160c7
25 files changed
+51 -12

No files matched your search

+9 -2
View File
@@ -26,7 +26,13 @@ class KataGoEngine:
"""Starts and communicates with the KataGO analysis engine"""
# TODO: we don't support suicide in game.py, so no "tt": "tromp-taylor", "nz": "new-zealand"
RULESETS_ABBR = [("jp", "japanese"), ("cn", "chinese"), ("ko", "korean"), ("aga", "aga"), ("stone_scoring", "stone_scoring")]
RULESETS_ABBR = [
("jp", "japanese"),
("cn", "chinese"),
("ko", "korean"),
("aga", "aga"),
("stone_scoring", "stone_scoring"),
]
RULESETS = {fromkey: name for abbr, name in RULESETS_ABBR for fromkey in [abbr, name]}
@staticmethod
@@ -103,7 +109,8 @@ class KataGoEngine:
)
except (FileNotFoundError, PermissionError, OSError) as e:
self.katrain.log(
i18n._("Starting Kata failed").format(command=self.command, error=e), OUTPUT_ERROR,
i18n._("Starting Kata failed").format(command=self.command, error=e),
OUTPUT_ERROR,
)
return # don't start
self.analysis_thread = threading.Thread(target=self._analysis_read_thread, daemon=True)
+7 -2
View File
@@ -435,7 +435,9 @@ class Game:
return f"{base_game_name} {self.game_id}.sgf"
def write_sgf(
self, filename: str, trainer_config: Optional[Dict] = None,
self,
filename: str,
trainer_config: Optional[Dict] = None,
):
if trainer_config is None:
trainer_config = self.katrain.config("trainer", {})
@@ -583,7 +585,10 @@ class Game:
analyze_and_play_policy(new_node)
self.engines[node.next_player].request_analysis(
new_node, callback=set_analysis, priority=-1000, analyze_fast=True,
new_node,
callback=set_analysis,
priority=-1000,
analyze_fast=True,
)
analyze_and_play_policy(cn)
+7 -1
View File
@@ -319,7 +319,13 @@ class GameNode(SGFNode):
text += i18n._("Info:point loss").format(points_lost=points_lost) + "\n"
top_move = previous_top_move["move"]
score = self.format_score(previous_top_move["scoreLead"])
text += i18n._("Info:top move").format(top_move=top_move, score=score,) + "\n"
text += (
i18n._("Info:top move").format(
top_move=top_move,
score=score,
)
+ "\n"
)
else:
text += i18n._("Info:best move") + "\n"
if previous_top_move.get("pv") and (sgf or details):