From ddd924d54156943defc9e4150e69280577866fca Mon Sep 17 00:00:00 2001 From: Darina Date: Fri, 20 May 2022 17:27:20 +0200 Subject: [PATCH 1/4] Make installable for higher python versions --- .idea/workspace.xml | 52 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 9 +++++++- tox.ini | 2 +- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..2b648e8 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1653055023241 + + + + + + \ No newline at end of file diff --git a/setup.py b/setup.py index 738c983..bac901c 100644 --- a/setup.py +++ b/setup.py @@ -45,11 +45,18 @@ def run_tests(self): 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: Jython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Games/Entertainment'], - install_requires=['distribute'], + install_requires=['distribute; python_version < "3.6.5"'], test_suite='glicko2tests', tests_require=['pytest'], ) diff --git a/tox.ini b/tox.ini index 4e2de28..fc38ea0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py25, py26, py27, py31, py32, py33, pypy, jython +envlist = py25, py26, py27, py31, py32, py33, py34, py35, py36, py37, py38, py39, py310, pypy, jython [testenv] commands = {envpython} setup.py test From baa662370cfb61653fd8f354a0676bcd3f6762c8 Mon Sep 17 00:00:00 2001 From: Darina Date: Fri, 20 May 2022 17:27:54 +0200 Subject: [PATCH 2/4] Remove workspace.xml --- .idea/workspace.xml | 52 --------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 2b648e8..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1653055023241 - - - - - - \ No newline at end of file From 8f4ea2cfe5ad87e7c111723f1c747ee5be2c63ac Mon Sep 17 00:00:00 2001 From: Darina Goldin Date: Mon, 5 Sep 2022 16:16:03 +0200 Subject: [PATCH 3/4] Stabilize algorithm Without this, too large differences in rating lead to division by 0. --- glicko2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glicko2.py b/glicko2.py index 30171ed..39d0d8b 100644 --- a/glicko2.py +++ b/glicko2.py @@ -80,7 +80,7 @@ def reduce_impact(self, rating): return 1 / math.sqrt(1 + (3 * rating.phi ** 2) / (math.pi ** 2)) def expect_score(self, rating, other_rating, impact): - return 1. / (1 + math.exp(-impact * (rating.mu - other_rating.mu))) + return max(min(1. / (1 + math.exp(-impact * (rating.mu - other_rating.mu))), 0.999999), 0.0000001) def determine_sigma(self, rating, difference, variance): """Determines new sigma.""" From b4ea3006b22bb549784d02f7bd8f94c8925dff5b Mon Sep 17 00:00:00 2001 From: Darina Goldin Date: Mon, 5 Sep 2022 17:12:16 +0200 Subject: [PATCH 4/4] Revert commit Reverts 8f4ea2cfe5ad87e7c111723f1c747ee5be2c63ac --- glicko2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glicko2.py b/glicko2.py index 39d0d8b..30171ed 100644 --- a/glicko2.py +++ b/glicko2.py @@ -80,7 +80,7 @@ def reduce_impact(self, rating): return 1 / math.sqrt(1 + (3 * rating.phi ** 2) / (math.pi ** 2)) def expect_score(self, rating, other_rating, impact): - return max(min(1. / (1 + math.exp(-impact * (rating.mu - other_rating.mu))), 0.999999), 0.0000001) + return 1. / (1 + math.exp(-impact * (rating.mu - other_rating.mu))) def determine_sigma(self, rating, difference, variance): """Determines new sigma."""