positive note, wait to finish

This commit is contained in:
Sander Land committed 2020-11-02 20:48:01 +01:00
1 parent 162aa8501f
commit 88d8decaa5
5 files changed
+11 -7

No files matched your search

+2 -1
View File
@@ -1,10 +1,11 @@
This repository includes: This repository includes:
1. Binaries for 'KataGo', which is Copyright 2019 David J Wu et al. 1. Binaries for 'KataGo', which is Copyright David J Wu et al.
For on related licenses for these binaries and libraries see https://github.com/lightvector/KataGo For on related licenses for these binaries and libraries see https://github.com/lightvector/KataGo
2. Icons from www.flaticon.com, used with permission with the following attributions: 2. Icons from www.flaticon.com, used with permission with the following attributions:
- Equalize icon and Thrash Icon: derived from work by bqlqn from www.flaticon.com - Equalize icon and Thrash Icon: derived from work by bqlqn from www.flaticon.com
- Local search icon: derived from work by Pixel Perfect from www.flaticon.com
- Other Menu icons and Flag icons: derived from work by Freepik from www.flaticon.com - Other Menu icons and Flag icons: derived from work by Freepik from www.flaticon.com
3. The True Type Font DIGITAL-7 version 1.02 by Sizenko Alexander, which is free for non-commercial use. 3. The True Type Font DIGITAL-7 version 1.02 by Sizenko Alexander, which is free for non-commercial use.
+3 -3
View File
@@ -49,13 +49,13 @@ class KaTrainBase:
"""Settings, logging, and players functionality, so other classes like bots who need a katrain instance can be used without a GUI""" """Settings, logging, and players functionality, so other classes like bots who need a katrain instance can be used without a GUI"""
def __init__(self, force_package_config=False, debug_level=0, **kwargs): def __init__(self, force_package_config=False, debug_level=None, **kwargs):
self.debug_level = debug_level self.debug_level = debug_level or 0
self.game = None self.game = None
self.logger = lambda message, level=OUTPUT_INFO: self.log(message, level) self.logger = lambda message, level=OUTPUT_INFO: self.log(message, level)
self.config_file = self._load_config(force_package_config=force_package_config) self.config_file = self._load_config(force_package_config=force_package_config)
self.debug_level = debug_level or self.config("general/debug_level", OUTPUT_INFO) self.debug_level = self.config("general/debug_level", OUTPUT_INFO) if debug_level is None else debug_level
Config.set("kivy", "log_level", "warning") Config.set("kivy", "log_level", "warning")
if self.debug_level >= OUTPUT_DEBUG: if self.debug_level >= OUTPUT_DEBUG:
+5 -2
View File
@@ -134,11 +134,14 @@ class KataGoEngine:
raise EngineDiedException(died_msg) raise EngineDiedException(died_msg)
return ok return ok
def wait_to_finish(self):
while self.queries and self.katago_process and self.katago_process.poll() is None:
time.sleep(0.1)
def shutdown(self, finish=False): def shutdown(self, finish=False):
process = self.katago_process process = self.katago_process
if finish and process: if finish and process:
while self.queries and process.poll() is None: self.wait_to_finish()
time.sleep(0.1)
if process: if process:
self.katago_process = None self.katago_process = None
process.terminate() process.terminate()
+1 -1
View File
@@ -469,7 +469,7 @@ class BadukPanWidget(Widget):
source="img/topmove.png", source="img/topmove.png",
) )
if self.trainer_config["text_point_loss"] and text_on: if self.trainer_config["text_point_loss"] and text_on:
if move_dict["pointsLost"] < 0.05: if -0.05 < move_dict["pointsLost"] < 0.05:
ptloss_text = "0.0" ptloss_text = "0.0"
else: else:
ptloss_text = f"{-move_dict['pointsLost']:+.1f}" ptloss_text = f"{-move_dict['pointsLost']:+.1f}"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB