* edit katrain/__main__.py

* delay / 0

* edit katrain/core/constants.py

* edit ENGINE.md

* fix bug

* fix bug

* fix scroll variations

* edit katrain/core/sgf_parser.py, edit tests/test_parser.py and 4 other changes

* fix touchscreen

* antimirror

* openssl dir try

* openssl dir try

* fix log

* openssl

* auto version in osx

* edit .github/workflows/osxbuild.yaml

* edit .github/workflows/osxbuild.yaml

* edit katrain/KataGo/katago

* better pondering

* new downloads

* middle click add variation

* change middle click pv

* more tweaks

* black

Co-authored-by: Sander Land <sander.land@futurefacts.nl>
Co-authored-by: Sander Land <sander.land@cognite.com>
Co-authored-by: Sander Land <sander@chatdesk.com>
This commit is contained in:
authored and GitHub committed 2021-10-31 19:54:19 +01:00
1 parent f368f1dcfa
commit 6005579c53
38 files changed
+263 -100

No files matched your search

+27 -14
View File
@@ -53,6 +53,7 @@ class BaseGame:
move_tree: GameNode = None,
game_properties: Optional[Dict] = None,
sgf_filename=None,
bypass_config=False, # TODO: refactor?
):
self.katrain = katrain
self._lock = threading.Lock()
@@ -83,18 +84,24 @@ class BaseGame:
): # 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")
rules = katrain.config("game/rules")
self.komi = katrain.config("game/komi")
default_properties = {**Game.DEFAULT_PROPERTIES, "DT": self.game_id}
if not bypass_config:
default_properties.update(
{
"SZ": katrain.config("game/size"),
"KM": katrain.config("game/komi"),
"RU": katrain.config("game/rules"),
}
)
self.root = GameNode(
properties={
**Game.DEFAULT_PROPERTIES,
**{"SZ": board_size, "KM": self.komi, "DT": self.game_id, "RU": rules},
**default_properties,
**(game_properties or {}),
}
)
self.komi = self.root.komi
handicap = katrain.config("game/handicap")
if handicap:
if not bypass_config and handicap:
self.root.place_handicap_stones(handicap)
if not self.root.get_property("RU"): # if rules missing in sgf, inherit current
@@ -558,22 +565,27 @@ class Game(BaseGame):
cn = self.current_node
if mode == "stop":
self.katrain.pondering = False
for e in set(self.engines.values()):
e.stop_pondering()
e.terminate_queries()
self.katrain.idle_analysis = False
return
engine = self.engines[cn.next_player]
Clock.schedule_once(self.katrain.analysis_controls.hints.activate, 0)
if mode == "ponder":
cn.analyze(
engine,
ponder=True,
priority=PRIORITY_EXTRA_ANALYSIS,
region_of_interest=self.region_of_interest,
time_limit=False,
)
return
if mode == "extra":
if kwargs.get("continuous", False):
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)
visits = cn.analysis_visits_requested + engine.config["max_visits"]
self.katrain.controls.set_status(i18n._("extra analysis").format(visits=visits), STATUS_ANALYSIS)
cn.analyze(
engine,
@@ -583,6 +595,7 @@ class Game(BaseGame):
time_limit=False,
)
return
if mode == "game":
nodes = self.root.nodes_in_tree
only_mistakes = kwargs.get("mistakes_only", False)