Coder Social home page Coder Social logo

berserk's People

Contributors

benediktwerner avatar diegocornejo avatar dignissimus avatar haklein avatar iandioch avatar jrwaine avatar kraktus avatar llimllib avatar rhgrant10 avatar rowan441 avatar rpgraham84 avatar sdia avatar trevorbayless avatar valvin1 avatar zackclements avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

berserk's Issues

Broadcast rounds not supported

The implementation of the broadcast API seems outdated as it doesn't support rounds.

More specifically, the following endpoints are not implemented:

  • Create a round: /broadcast/{broadcastTournamentId}/new
  • Get a round: /broadcast/{broadcastTournamentSlug}/{broadcastRoundSlug}/{broadcastRoundId}
  • Update round: /broadcast/round/{broadcastRoundId}/edit

And these are outdated:

Dev dependencies installed when downloading the package.

  • berserk version: 0.11.4
  • Python version: python 3.9.3
  • Operating System: MacOs 11

pip3 install berserk-downstream resulted in dev dependencies being installed as well:

Successfully installed Jinja2-3.0.1 MarkupSafe-2.0.1 PyYAML-5.4.1 Pygments-2.10.0 Sphinx-2.3.1 alabaster-0.7.12 argh-0.26.2 attrs-21.2.0 babel-2.9.1 backports.entry-points-selectable-1.1.0 berserk-downstream-0.11.4 bleach-4.0.0 bumpversion-0.5.3 certifi-2021.5.30 charset-normalizer-2.0.4 codecov-2.0.22 coverage-5.0.1 deprecated-1.2.12 distlib-0.3.2 docutils-0.17.1 entrypoints-0.3 filelock-3.0.12 flake8-3.7.9 idna-3.2 imagesize-1.2.0 importlib-metadata-4.6.4 keyring-23.1.0 mccabe-0.6.1 more-itertools-8.8.0 ndjson-0.3.1 packaging-21.0 pathtools-0.1.2 pip-19.3.1 pkginfo-1.7.1 platformdirs-2.2.0 pluggy-0.13.1 py-1.10.0 pycodestyle-2.5.0 pyflakes-2.1.1 pyparsing-2.4.7 pytest-5.3.2 pytest-cov-2.8.1 pytest-runner-5.2 pytz-2021.1 readme-renderer-29.0 requests-2.26.0 requests-toolbelt-0.9.1 six-1.16.0 snowballstemmer-2.1.0 sphinx-rtd-theme-0.4.3 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 toml-0.10.2 tox-3.14.3 tqdm-4.62.1 twine-3.1.1 urllib3-1.26.6 virtualenv-20.7.2 watchdog-0.9.0 wcwidth-0.2.5 webencodings-0.5.1 wheel-0.33.6 wrapt-1.12.1 zipp-3.5.0

The first move of a game is always with several seconds of delay

well, that.
Im using te last version of Berserk in a rpi zero w (a little machine but powerful enough for make the work.)
I import berserk at the beginning and all work pretty fine, except that always the FIRST MOVE to make in a game take almost 7 seconds more or less.
There could be a reason for this? i can maybe make something to avoid this?
Thanks!

ps.: i ask in the lichess discord and they tall me to look here in the code, but, I'm pretty nooby and, i look at the code but, dont understand what could be.
Thanks.

ps.2:This just happens to me or is expected?

Berserk has no attribute 'Client'

  • berserk version: 0.11.12
  • Python version:3.11
  • Operating System:Kali Linux

Description

Describe what you were trying to get done.

I am a AI engineer, I was making a self learning AI for lichess that I could play against, but it ended up with this error.

Tell us what happened, what went wrong, and what you expected to happen.

I was going to test the AI, I expected it to well, work! But fate has a different plan as I get this freak error.

What I Did

nothing, I just coded it and followed the guide and command guide and everything.

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Traceback (most recent call last):
  File "/home/user/Desktop/ChessAI4/chessAI/agenttwo.py", line 794, in <module>
    agent = DQNAgent()
            ^^^^^^^^^^
  File "/home/user/Desktop/ChessAI4/chessAI/agenttwo.py", line 171, in __init__
    self.client = berserk.Client(berserk.TokenSession(self.token))
                  ^^^^^^^^^^^^^^
AttributeError: module 'berserk' has no attribute 'Client'
^CException ignored in: <module 'threading' from '/usr/lib/python3.11/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1583, in _shutdown
    lock.acquire()
KeyboardInterrupt: 

client.tournaments.get_tournament fails with TypeError

  • berserk version: 0.11.9
  • Python version: 3.9
  • Operating System: macOS Monterey Version 12.5.1

Description

I'm trying to fetch information for one of the recent Chess960 Qualifier open arenas with client.tournaments.get_tournament.

What I Did

import berserk

client = berserk.Client()
print(client.tournaments.get_tournament("MuVtmdah"))
Traceback (most recent call last):
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/get_unique_players_in_tournament_list.py", line 4, in <module>
    print(client.tournaments.get_tournament("MuVtmdah"))
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/venv/lib/python3.9/site-packages/berserk/clients.py", line 999, in get_tournament
    return self._r.get(path, converter=models.Tournaments.convert_values)
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/venv/lib/python3.9/site-packages/berserk/session.py", line 60, in get
    return self.request('GET', *args, **kwargs)
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/venv/lib/python3.9/site-packages/berserk/session.py", line 56, in request
    return fmt.handle(response, is_stream=is_stream, converter=converter)
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/venv/lib/python3.9/site-packages/berserk/formats.py", line 35, in handle
    return converter(self.parse(response))
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/venv/lib/python3.9/site-packages/berserk/models.py", line 27, in convert_values
    data[k] = cls.convert(data[k])
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/venv/lib/python3.9/site-packages/berserk/models.py", line 16, in convert
    return cls.convert_one(data)
  File "/Users/qpwoeirut/OtherProgramming/LichessProjects/venv/lib/python3.9/site-packages/berserk/models.py", line 20, in convert_one
    for k in set(data) & set(cls.conversions):
TypeError: 'int' object is not iterable

Running client.tournaments.get works fine, if that helps. I made a quick workaround hack by changing the conversion code in models.py, but I'm not sure if that will break other things.

Original code (lines 11-16 in models.py)

class Model(metaclass=model):
    @classmethod
    def convert(cls, data):
        if isinstance(data, (list, tuple)):
            return [cls.convert_one(v) for v in data]
        return cls.convert_one(data)

Modified code

class Model(metaclass=model):
    @classmethod
    def convert(cls, data):
        if isinstance(data, (list, tuple)):
            return [cls.convert_one(v) for v in data]
        return data  # only this last line changes

Let me know if you need any more information!

export_by_player doesn't have a clocks param

  • berserk version: Yanked 0.11.4 release
  • Python version: Python 3.6.9
  • Operating System: Google Colab Jupyter Notebook

Description

export_by_player does not actually take the clocks param, though the documentation says it does (and API allows it).

This appears to be a dupe of rhgrant10/berserk#14 (which seems unmaintained)

What I Did

games = client.games.export_by_player(username="junglebook1", clocks=True)

TypeError: export_by_player() got an unexpected keyword argument 'clocks'

Berserk `since` and `until` should be integers

  • berserk version: berserk-downstream 0.11.6
  • Python version: Python 3.9.5
  • Operating System: Mac

Description

Games export API expects integer timestamps, but berserk sends floats.

If you go here: https://lichess.org/api#operation/apiGamesUser
You see that since and until expect integers.

utils.to_millis(dt) does not return integer seconds, it returns floats, per https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp

As is, the berserk timestamps are completely ignored.

What I Did

Try running the example from the docs, but I changed to a 10 minute window:

start = berserk.utils.to_millis(dt.datetime(2018, 12, 8, 1, 10))
end = berserk.utils.to_millis(dt.datetime(2018, 12, 8, 1, 20))
print(f'Query from {start} to {end}')
games = lichess.games.export_by_player('LeelaChess', since=start, until=end, max=300)
print(f'Found {len(list(games))} Leela games')

start, end = int(start), int(end)  # Convert to ints
print(f'Query from {start} to {end}')
games = lichess.games.export_by_player('LeelaChess', since=start, until=end, max=300)
print(f'Found {len(list(games))} Leela games')

Output:

Query from 1544260200000.0 to 1544260800000.0
Found 300 Leela games  # Hit max!
Query from 1544260200000 to 1544260800000
Found 3 Leela games  # Presumably correct

function get_realtime_statuses not work properly

  • berserk version: berserk-downstream 0.11.8
  • Python version: 3.8.10
  • Operating System: Ubuntu 20.04

Description

I am trying to call the function get_realtime_statuses.
import berserk

session = berserk.TokenSession(API_TOKEN)
client = berserk.Client(session=session)
client.users.get_realtime_statuses(['Sasageyo', 'Voinikonis_Nikita', 'Zugzwangerz'])

Output

What i have got:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/lichess/venv/lib/python3.8/site-packages/berserk/clients.py", line 193, in get_realtime_statuses
params = {'ids': ','.join(user_ids)}
TypeError: sequence item 0: expected str instance, list found

In source code of this function i've found this string:
params = {'ids': ','.join(user_ids)}

and withoung calling directly get_realtime_statuses:

params = {'ids': ','.join(['Sasageyo', 'Voinikonis_Nikita', 'Zugzwangerz'])} returns {'ids': 'Sasageyo,Voinikonis_Nikita,Zugzwangerz'}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.