komi display, fix fox
This commit is contained in:
1 parent
fd67ea8491
commit
341d016348
7 files changed
+35
-11
No files matched your search
@@ -61,8 +61,8 @@ class KaTrainBase:
|
||||
if self.debug_level >= OUTPUT_DEBUG:
|
||||
Config.set("kivy", "log_enable", 1)
|
||||
Config.set("kivy", "log_level", "debug")
|
||||
if self.debug_level >= OUTPUT_EXTRA_DEBUG:
|
||||
Config.set("kivy", "log_level", "trace")
|
||||
# if self.debug_level >= OUTPUT_EXTRA_DEBUG:
|
||||
# Config.set("kivy", "log_level", "trace")
|
||||
self.players_info = {"B": Player("B"), "W": Player("W")}
|
||||
self.reset_players()
|
||||
|
||||
|
||||
@@ -226,8 +226,9 @@ class KataGoEngine:
|
||||
next_move: Optional[GameNode] = None,
|
||||
extra_settings: Optional[Dict] = None,
|
||||
):
|
||||
moves = [m for node in analysis_node.nodes_from_root for m in node.moves]
|
||||
initial_stones = analysis_node.root.placements
|
||||
nodes = analysis_node.nodes_from_root
|
||||
moves = [m for node in nodes for m in node.moves]
|
||||
initial_stones = [m for node in nodes for m in node.placements]
|
||||
if next_move:
|
||||
moves.append(next_move)
|
||||
if ownership is None:
|
||||
|
||||
@@ -55,7 +55,11 @@ class Game:
|
||||
self.root = move_tree
|
||||
self.komi = self.root.komi
|
||||
handicap = int(self.root.get_property("HA", 0))
|
||||
if handicap >= 2 and not self.root.placements:
|
||||
if (
|
||||
handicap >= 2
|
||||
and not self.root.placements
|
||||
and not (not self.root.move_with_placements and self.root.children and self.root.children[0].placements)
|
||||
): # not really according to sgf, and not sure if still needed, last clause for fox
|
||||
self.root.place_handicap_stones(handicap)
|
||||
else:
|
||||
board_size = katrain.config("game/size")
|
||||
@@ -310,7 +314,9 @@ class Game:
|
||||
|
||||
if mode == "extra":
|
||||
if kwargs.get("continuous", False):
|
||||
visits = max(engine.config["max_visits"], math.ceil(cn.analysis_visits_requested * 1.25))
|
||||
visits = min(
|
||||
1_000_000_000, max(engine.config["max_visits"], math.ceil(cn.analysis_visits_requested * 1.25))
|
||||
)
|
||||
else:
|
||||
visits = cn.analysis_visits_requested + engine.config["max_visits"]
|
||||
self.katrain.controls.set_status(i18n._("extra analysis").format(visits=visits), STATUS_ANALYSIS)
|
||||
|
||||
@@ -333,9 +333,15 @@ class SGF:
|
||||
match = re.search(cls.SGF_PAT, input_str)
|
||||
clipped_str = match.group() if match else input_str
|
||||
root = cls(clipped_str).root
|
||||
# Fix weird FoxGo server KM values
|
||||
if "foxwq" in root.get_list_property("AP"):
|
||||
fixed_komi = 0.5 if root.get_property("HA") == 1 else 7.5
|
||||
root.set_property("KM", fixed_komi)
|
||||
if int(root.get_property("HA", 0)) >= 1:
|
||||
corrected_komi = 0.5
|
||||
elif root.get_property("RU").lower() in ["chinese", "cn"]:
|
||||
corrected_komi = 7.5
|
||||
else:
|
||||
corrected_komi = 6.5
|
||||
root.set_property("KM", corrected_komi)
|
||||
return root
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in new issue
Block a user