Skip to content

Commit

Permalink
Version R2.12d
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed Mar 24, 2024
1 parent e460477 commit a2d29d0
Show file tree
Hide file tree
Showing 98 changed files with 2,330 additions and 1,190 deletions.
671 changes: 671 additions & 0 deletions Resources/GM/Rubinstein.xgm

Large diffs are not rendered by default.

Binary file modified Resources/Locale/ar/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/az/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/br/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/ca/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/cs/LC_MESSAGES/lucaschess.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Locale/cs/lang.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME=Čeština
AUTHOR=Jindrich Skula
%=54
%=53
Binary file modified Resources/Locale/de/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/en/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/es/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/eu/LC_MESSAGES/lucaschess.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Locale/eu/lang.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME=Euskara
AUTHOR=Ilurdi
%=91
%=90
Binary file modified Resources/Locale/fi/LC_MESSAGES/lucaschess.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Locale/fi/lang.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME=Suomi
AUTHOR=Heikki J.
%=56
%=55
Binary file modified Resources/Locale/fr/LC_MESSAGES/lucaschess.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Locale/fr/lang.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME=Français
AUTHOR=Eric, Lolo S.
PREVIOUS=Max Aloyau, Gamez-sy
%=100
%=99
Binary file modified Resources/Locale/gr/LC_MESSAGES/lucaschess.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Locale/gr/lang.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME=Eλληνικά
AUTHOR=Nick Delta
%=100
%=99
Binary file modified Resources/Locale/hu/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/id/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/it/LC_MESSAGES/lucaschess.mo
Binary file not shown.
1,392 changes: 722 additions & 670 deletions Resources/Locale/messages.pot

Large diffs are not rendered by default.

Binary file modified Resources/Locale/nl/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/pl/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/po/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/ro/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/ru/LC_MESSAGES/lucaschess.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion Resources/Locale/ru/lang.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME=Pусский
AUTHOR=Reinhard,Johannes Bolzano,Vladimir
PREVIOUS=Nils Andersson,Reinhard,Slavik Pavlov
%=97
%=96
Binary file modified Resources/Locale/si/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/sv/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/tr/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/uk/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/vi/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Resources/Locale/zh/LC_MESSAGES/lucaschess.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions bin/Code/Analysis/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from Code.Engines import EngineResponse
from Code.QT import QTUtil
from Code.QT import QTUtil2
from Code.QT import QTVarios


class ControlAnalysis:
Expand Down Expand Up @@ -278,7 +279,6 @@ def show_analysis(procesador, xtutor, move, is_white, pos_move, main_window=None
if not tab_analysis0:
return
wa = WindowAnalysis.WAnalisis(ma, main_window, is_white, must_save, tab_analysis0, subanalysis=subanalysis)
# wa.show()
if subanalysis:
wa.show()
else:
Expand Down Expand Up @@ -408,7 +408,7 @@ def process_toolbar(self, accion):
elif accion == "MoverFEN":
move = self.game_analyzer.move(self.pos_analyzer)
QTUtil.ponPortapapeles(move.position.fen())
QTUtil2.message_bold(self.w, _("FEN is in clipboard"))
QTVarios.fen_is_in_clipboard(self.w)

def moving_analyzer(self, si_inicio=False, n_saltar=0, si_final=False, is_base=False):
if n_saltar:
Expand Down
116 changes: 88 additions & 28 deletions bin/Code/Analysis/AnalysisEval.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,18 @@ def base(xcp):
def lv(self, cp: int) -> float:
return self._lv(cp, self.conf.x_eval_curve_degree)

def lv_dif(self, cp, cp_best):
return self.lv(cp_best) - self.lv(cp)
def lv_dif(self, cp_best, cp_other):
return self.lv(cp_best) - self.lv(cp_other)

def evaluate(self, rm_j, rm_c):
dif = self.evaluate_dif(rm_j, rm_c)
def evaluate_dif(self, rm_best, rm_player):
if rm_best.mate == 0 and rm_player.mate == 0:
return self.lv_dif(rm_best.puntos, rm_player.puntos)

if dif >= self.conf.x_eval_blunder:
return BLUNDER
if dif >= self.conf.x_eval_mistake:
return MISTAKE
if dif >= self.conf.x_eval_inaccuracy:
return INACCURACY
return NO_RATING

def evaluate_dif(self, rm_j, rm_c):
if rm_j.mate == 0 and rm_c.mate == 0:
return self.lv_dif(rm_c.puntos, rm_j.puntos)

elif rm_c.mate == 0:
if rm_j.mate > self.conf.x_eval_mate_human:
elif rm_player.mate == 0:
if rm_best.mate > self.conf.x_eval_mate_human:
xadd = self.conf.x_eval_inaccuracy
else:
dif_mate = self.conf.x_eval_mate_human - rm_j.mate
dif_mate = self.conf.x_eval_mate_human - rm_best.mate
if dif_mate >= self.conf.x_eval_difmate_blunder:
xadd = self.conf.x_eval_blunder
elif dif_mate >= self.conf.x_eval_difmate_mistake:
Expand All @@ -57,13 +46,13 @@ def evaluate_dif(self, rm_j, rm_c):
else:
xadd = 0

return self.lv_dif(rm_c.puntos, self.conf.x_eval_limit_score) + xadd
return self.lv_dif(self.conf.x_eval_limit_score, rm_player.puntos) + xadd

elif rm_j.mate == 0 and rm_c.mate < 0:
return max(self.lv_dif(rm_c.centipawns_abs(), rm_j.centipawns_abs()), self.conf.x_eval_mistake)
elif rm_best.mate == 0 and rm_player.mate < 0:
return max(self.lv_dif(rm_best.centipawns_abs(), rm_player.centipawns_abs()), self.conf.x_eval_mistake)

else:
dif_mate = rm_j.mate - rm_c.mate
dif_mate = rm_best.mate - rm_player.mate
if dif_mate >= self.conf.x_eval_difmate_blunder:
return self.conf.x_eval_blunder
if dif_mate >= self.conf.x_eval_difmate_mistake:
Expand All @@ -72,8 +61,19 @@ def evaluate_dif(self, rm_j, rm_c):
return self.conf.x_eval_mistake
return 0

def elo(self, rm_j, rm_c):
dif = self.evaluate_dif(rm_j, rm_c)
def evaluate(self, rm_best, rm_player):
dif = self.evaluate_dif(rm_best, rm_player)

if dif >= self.conf.x_eval_blunder:
return BLUNDER
if dif >= self.conf.x_eval_mistake:
return MISTAKE
if dif >= self.conf.x_eval_inaccuracy:
return INACCURACY
return NO_RATING

def elo(self, rm_best, rm_player):
dif = self.evaluate_dif(rm_best, rm_player)
mx = self.conf.x_eval_max_elo
mn = self.conf.x_eval_min_elo
bl2 = self.conf.x_eval_blunder * 1.5
Expand All @@ -90,10 +90,70 @@ def elo(self, rm_j, rm_c):
rg = max(mx - mn, 0)
return int((bl2 - dif / 10) * rg / bl2 + mn)

def elo_bad_vbad(self, rm_j, rm_c):
elo = self.elo(rm_j, rm_c)
ev = self.evaluate(rm_j, rm_c)
def elo_bad_vbad(self, rm_best, rm_player):
elo = self.elo(rm_best, rm_player)
ev = self.evaluate(rm_best, rm_player)
bad = ev == MISTAKE
vbad = ev == BLUNDER
quest = ev == INACCURACY
return elo, quest, bad, vbad

# def calc_accuracy_game(self, game, factor=14):
# n_jg = n_jg_w = n_jg_b = 0
# porc_t = porc_w = porc_b = 0
#
# for num, move in enumerate(game.li_moves):
# if move.analysis:
# mrm, pos = move.analysis
# rm_best = mrm.li_rm[0]
# rm_player = mrm.li_rm[pos]
# porc_win = 100.0 - min(self.evaluate_dif(rm_best, rm_player)*factor, 100.0)
# is_white = move.is_white()
#
# porc_t += porc_win
# n_jg += 1
#
# if is_white:
# n_jg_w += 1
# porc_w += porc_win
#
# else:
# n_jg_b += 1
# porc_b += porc_win
#
# porc_t = porc_t * 1.0 / n_jg if n_jg else None
# porc_w = porc_w * 1.0 / n_jg_w if n_jg_w else None
# porc_b = porc_b * 1.0 / n_jg_b if n_jg_b else None
#
# return porc_w, porc_b, porc_t

@staticmethod
def calc_accuracy_game(game):
n_jg = n_jg_w = n_jg_b = 0
porc_t = porc_w = porc_b = 0

for num, move in enumerate(game.li_moves):
if move.analysis:
mrm, pos = move.analysis
is_white = move.is_white()
pts = mrm.li_rm[pos].centipawns_abs()
pts0 = mrm.li_rm[0].centipawns_abs()
lostp_abs = pts0 - pts

porc = 100 - lostp_abs if lostp_abs < 100 else 0
porc_t += porc

n_jg += 1
if is_white:
n_jg_w += 1
porc_w += porc
else:
n_jg_b += 1
porc_b += porc

porc_t = porc_t * 1.0 / n_jg if n_jg else None
porc_w = porc_w * 1.0 / n_jg_w if n_jg_w else None
porc_b = porc_b * 1.0 / n_jg_b if n_jg_b else None

return porc_w, porc_b, porc_t

24 changes: 18 additions & 6 deletions bin/Code/Analysis/AnalysisGame.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,25 @@ def dispatch_bp(self, rut_dispatch_bp):
"""
self.rut_dispatch_bp = rut_dispatch_bp

def save_fns(self, file, fen):
def save_brilliancies_fns(self, file, fen, mrm, game: Game.Game, njg):
"""
Graba cada fen encontrado en el file "file"
"""
if not file:
return

cab = ""
for k, v in game.dicTags().items():
ku = k.upper()
if not (ku in ("RESULT", "FEN")):
cab += '[%s "%s"]' % (k, v)

game_raw = Game.game_raw(game)
p = Game.Game(fen=fen)
rm = mrm.li_rm[0]
p.read_pv(rm.pv)
with open(file, "at", encoding="utf-8", errors="ignore") as f:
f.write("%s\n" % fen)
f.write(f"{fen}||{p.pgnBaseRAW()}|{cab} {game_raw.pgnBaseRAWcopy(None, njg - 1)}")
self.procesador.entrenamientos.menu = None

def graba_tactic(self, game, njg, mrm, pos_act):
Expand Down Expand Up @@ -197,16 +207,17 @@ def graba_tactic(self, game, njg, mrm, pos_act):
p = Game.Game(fen=fen)
rm = mrm.li_rm[0]
p.read_pv(rm.pv)
game_raw = Game.game_raw(game)
with open(Util.opj(self.tacticblunders, before), "at", encoding="utf-8", errors="ignore") as f:
f.write("%s||%s|%s%s\n" % (fen, p.pgnBaseRAW(), cab, game.pgnBaseRAWcopy(None, njg - 1)))
f.write("%s||%s|%s%s\n" % (fen, p.pgnBaseRAW(), cab, game_raw.pgnBaseRAWcopy(None, njg - 1)))

fen = move.position.fen()
p = Game.Game(fen=fen)
rm = mrm.li_rm[pos_act]
li = rm.pv.split(" ")
p.read_pv(" ".join(li[1:]))
with open(Util.opj(self.tacticblunders, after), "at", encoding="utf-8", errors="ignore") as f:
f.write("%s||%s|%s%s\n" % (fen, p.pgnBaseRAW(), cab, game.pgnBaseRAWcopy(None, njg)))
f.write("%s||%s|%s%s\n" % (fen, p.pgnBaseRAW(), cab, game_raw.pgnBaseRAWcopy(None, njg)))

self.siTacticBlunders = True

Expand Down Expand Up @@ -377,7 +388,6 @@ def gui_dispatch(xrm):
return

cl_game = Util.huella()
txt_game = game.save()
si_poner_pgn_original_blunders = False
si_poner_pgn_original_brilliancies = False

Expand Down Expand Up @@ -506,17 +516,19 @@ def gui_dispatch(xrm):
si_poner_pgn_original_blunders = True

if self.bmtblunders:
txt_game = Game.game_raw(game).save()
self.save_bmt(True, fen, mrm, pos_act, cl_game, txt_game)
self.si_bmt_blunders = True

if move.is_brilliant():
move.add_nag(NAG_3)
self.save_fns(self.fnsbrilliancies, fen)
self.save_brilliancies_fns(self.fnsbrilliancies, fen, mrm, game, pos_current_move)

if self.save_pgn(self.pgnbrilliancies, mrm.name, game.dicTags(), fen, move, rm, None):
si_poner_pgn_original_brilliancies = True

if self.bmtbrilliancies:
txt_game = Game.game_raw(game).save()
self.save_bmt(False, fen, mrm, pos_act, cl_game, txt_game)
self.si_bmt_brilliancies = True

Expand Down
2 changes: 1 addition & 1 deletion bin/Code/Analysis/Histogram.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import math
import os

from PySide2 import QtCore, QtGui, QtWidgets

Expand Down
6 changes: 3 additions & 3 deletions bin/Code/Analysis/RunAnalysisControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def close(self):

class AnalysisMassiveWithWorkers:
def __init__(self, wowner, alm, nregs, li_seleccionadas):
self.dbGames = wowner.dbGames
self.db_games = wowner.db_games
self.grid = wowner.grid
self.wowner = wowner
self.li_seleccionadas = li_seleccionadas
Expand Down Expand Up @@ -132,7 +132,7 @@ def send_game_worker(self, num_worker):
else:
recno = self.pos_reg

game = self.dbGames.read_game_recno(recno)
game = self.db_games.read_game_recno(recno)
self.li_workers[num_worker].send_game(game, recno)
return True

Expand Down Expand Up @@ -170,7 +170,7 @@ def processing(self):

game = order.get("GAME")
recno = order.get("RECNO")
self.dbGames.save_game_recno(recno, game)
self.db_games.save_game_recno(recno, game)
self.num_games_analyzed += 1
self.window.set_pos(self.num_games_analyzed)

Expand Down
2 changes: 1 addition & 1 deletion bin/Code/Analysis/WindowAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def process_toolbar(self, accion):
self.jugarPosicion()
elif accion == "FEN":
QTUtil.ponPortapapeles(self.tab_analysis.fen_active())
QTUtil2.message_bold(self, _("FEN is in clipboard"))
QTVarios.fen_is_in_clipboard(self)

def jugarPosicion(self):
position, from_sq, to_sq = self.tab_analysis.active_position()
Expand Down
Loading

0 comments on commit a2d29d0

Please sign in to comment.