Skip to content

Commit

Permalink
Fixed bug to allow for searching players with special characters in t…
Browse files Browse the repository at this point in the history
…heir username
  • Loading branch information
souzatharsis committed Jul 13, 2021
1 parent 573b934 commit e630035
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 14 deletions.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/pyETT.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 132f96269b84295c115c2f79b9c8abea
config: 807abf75b139d4943d6573c6932e5000
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Overview: module code &mdash; pyETT 0.2.4 documentation</title>
<title>Overview: module code &mdash; pyETT 0.2.5 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.2.4',
VERSION: '0.2.5',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Index &mdash; pyETT 0.2.4 documentation</title>
<title>Index &mdash; pyETT 0.2.5 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Welcome to pyETT’s documentation! &mdash; pyETT 0.2.4 documentation</title>
<title>Welcome to pyETT’s documentation! &mdash; pyETT 0.2.5 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>pyETT &mdash; pyETT 0.2.4 documentation</title>
<title>pyETT &mdash; pyETT 0.2.5 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Python Module Index &mdash; pyETT 0.2.4 documentation</title>
<title>Python Module Index &mdash; pyETT 0.2.5 documentation</title>



Expand Down
4 changes: 2 additions & 2 deletions docs/build/html/pyETT.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>pyETT package &mdash; pyETT 0.2.4 documentation</title>
<title>pyETT package &mdash; pyETT 0.2.5 documentation</title>



Expand Down Expand Up @@ -258,7 +258,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<p>A class to represent Eleven Table Tennis (ETT).</p>
<dl class="py method">
<dt id="pyETT.ett.ETT.get_leaderboard">
<code class="sig-name descname">get_leaderboard</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">num_players</span><span class="o">=</span><span class="default_value">10</span></em><span class="sig-paren">)</span> &#x2192; List<span class="p">[</span><a class="reference internal" href="#pyETT.ett.Player" title="pyETT.ett.Player">pyETT.ett.Player</a><span class="p">]</span><a class="reference internal" href="_modules/pyETT/ett.html#ETT.get_leaderboard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyETT.ett.ETT.get_leaderboard" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">get_leaderboard</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">num_players</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">10</span></em><span class="sig-paren">)</span> &#x2192; List<span class="p">[</span><a class="reference internal" href="#pyETT.ett.Player" title="pyETT.ett.Player">pyETT.ett.Player</a><span class="p">]</span><a class="reference internal" href="_modules/pyETT/ett.html#ETT.get_leaderboard"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyETT.ett.ETT.get_leaderboard" title="Permalink to this definition"></a></dt>
<dd><p>Returns a list of players from the leaderboard.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/pyETT_demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Getting Started &mdash; pyETT 0.2.4 documentation</title>
<title>Getting Started &mdash; pyETT 0.2.5 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Search &mdash; pyETT 0.2.4 documentation</title>
<title>Search &mdash; pyETT 0.2.5 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = "Tharsis T. P. Souza"

# The full version, including alpha/beta/rc tags
release = "0.2.4"
release = "0.2.5"


# -- General configuration ---------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion pyETT/ett.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def __init__(self, match_id, match):
self.home_score = match["home-score"]
self.away_score = match["away-score"]
self.elo_change = match["elo-change"]
self.home_elo_avg = match["home-elo-avg"]
self.away_elo_avg = match["away-elo-avg"]


home_player_index = 0 if match["players"][0]["team"] == Player.HOME else 1
self.home_player = Player(
Expand Down Expand Up @@ -275,7 +278,7 @@ def user_search_dataframe(
]
).dropna(how="all", axis="columns")

def get_leaderboard(self, num_players=10) -> List[Player]:
def get_leaderboard(self, num_players: int = 10) -> List[Player]:
"""Returns a list of players from the leaderboard.
Args:
Expand Down
4 changes: 4 additions & 0 deletions pyETT/ett_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import aiohttp
import asyncio
import urllib.parse
import pandas as pd

import nest_asyncio # type: ignore
Expand Down Expand Up @@ -137,6 +138,8 @@ def request_matchup(user_id1, user_id2):

for match_data in res:
match = match_data["attributes"]
match["home-elo-avg"] = match.pop("home-elo")
match["away-elo-avg"] = match.pop("away-elo")
match["winning-team"] = match.pop("winner")
match["losing-team"] = 1 - match["winning-team"]

Expand Down Expand Up @@ -213,6 +216,7 @@ def request_leaderboard_official_tournament():


def user_search(username) -> List:
username = urllib.parse.quote(username)
async def request_user(session, url):
async with session.get(url) as resp:
user_page = await resp.json()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name="pyETT",
version="0.2.4",
version="0.2.5",
description="Python library for Eleven VR Table Tennis data",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit e630035

Please sign in to comment.