Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter of export_by_player since, end not working like documentation #18

Open
mendezr opened this issue Nov 3, 2020 · 0 comments
Open
Labels
bug Something isn't working

Comments

@mendezr
Copy link

mendezr commented Nov 3, 2020

  • berserk version: 0.10.0
  • Python version: Python 3.8.5
  • Operating System: Windows 10

Description

Follow the docs on the part of exporting games by player but is seems that since and end parameters is not working properly. I expected a subset of games filter by timestamp, instead got the max of recent games .

What I Did

start = berserk.utils.to_millis(datetime(2018, 12, 8))
end = berserk.utils.to_millis(datetime(2018, 12, 9))
games = list(client.games.export_by_player('LeelaChess', as_pgn=False, since=start, until=end,max=300))
print(len(games))

Output:
300

If I check the dates of the list I got:

print(games[0]['createdAt'], games[-1]['createdAt']) 

Output:
2020-04-14 02:57:30.645000+00:00 2020-04-01 04:02:40.694000+00:00

Reading the docs the function berserk.utils.to_millis look since and until as an int value, start and end are float. So I convert start and until to int

games = list(client.games.export_by_player('LeelaChess', as_pgn=False, since=int(start), until=int(end),max=300))
print(len(games))

Output:
291

And checking the dates

print(games[0]['createdAt'], games[-1]['createdAt']) 

Output:
2018-12-09 03:43:47.412000+00:00 2018-12-08 08:00:12.072000+00:00

It's work now. I can try to fix it make a PR if you can guide me (this my first issue)

@rhgrant10 rhgrant10 added the bug Something isn't working label Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants