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

Workflow test #40

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
9c9f703
Initial WIP C bindings
nhamil Nov 22, 2023
bce8245
resolve merge conflict with tournament output update
Nov 22, 2023
7dffaae
Fix argument checking for n_legal_moves
nhamil Nov 22, 2023
d5570d6
add Board_NumPlayerPcs C function for board.n_remaining_pieces
Nov 22, 2023
535ae09
Merge pull request #31 from nhamil/conard/add-c-Board_NumPlayerPcs
nhamil Nov 22, 2023
b60a08b
in submodule: add Tile.h to Tilewe.h, refactor for_each macros
Nov 22, 2023
55da698
fix engine selection in tournament, rename board copy
Nov 22, 2023
28aa459
implement n_player_corners with Board_NumPlayerOpenCorners C API func
Nov 22, 2023
30c18a9
implement player_corners with Board_PlayerOpenCorners C API function
Nov 22, 2023
c3663cc
refactor C API funcs with only for_player args to use ForPlayerArgHan…
Nov 22, 2023
dbe43eb
use the new Tw_Board_PlayerCorners and Tw_Board_NumPlayerCorners func…
Nov 23, 2023
0700318
Merge pull request #32 from nhamil/conard/c-extension-corners
nhamil Nov 23, 2023
6d3ef86
Add board.remaining_pieces()
nhamil Nov 23, 2023
7090fb9
Add C extension board functions: player_score, can_play, is_legal
nhamil Nov 23, 2023
703113b
Make kwlist const
nhamil Nov 23, 2023
be0524d
Merge pull request #33 from nhamil/nhamil/board-functions
nhamil Nov 23, 2023
8426df5
Move interface to __init__.py
nhamil Nov 23, 2023
e426ad7
Add tile_to_coords
nhamil Nov 23, 2023
b8c1ca9
Make move required in is_legal
nhamil Nov 23, 2023
adbf3fb
Add coords_to_tile
nhamil Nov 23, 2023
ee69812
Add bounds checking for tiles and coordinates
nhamil Nov 23, 2023
90fae40
Add n_piece_X functions
nhamil Nov 23, 2023
c6879f5
add elo error margin computation to tournaments
Nov 23, 2023
e08864a
update requirements
Nov 23, 2023
924a10f
Add piece_X functions
nhamil Nov 23, 2023
f15cd98
update estimated_elo comment
Nov 23, 2023
01e4c39
bump win rate col width for padding
Nov 23, 2023
e46023b
Add move getters
nhamil Nov 23, 2023
9d45bc5
enforce ranges on confidence/C
Nov 23, 2023
b943691
Add create_move
nhamil Nov 23, 2023
62cc956
Consider rotation when returning piece tiles
nhamil Nov 23, 2023
546ca28
Fix tournament match results when there is only one player
nhamil Nov 23, 2023
3ea3d28
Update sample engines to use new API
nhamil Nov 23, 2023
2bcdd78
allow override estimated elo
Nov 23, 2023
b38860c
Allow gen_moves to accept arguments
nhamil Nov 23, 2023
dbcb8de
improve the fix for single player tournament elo handling
Nov 23, 2023
20b4d2c
Merge branch 'nhamil/misc-functions' of github.com:nhamil/python-tile…
nhamil Nov 23, 2023
818980b
Change tests to use new API
nhamil Nov 23, 2023
24a874e
Update style
nhamil Nov 23, 2023
005342d
Merge pull request #35 from nhamil/nhamil/misc-functions
nhamil Nov 23, 2023
d024e18
Remove numpy from requirements
nhamil Nov 23, 2023
2f063db
Merge branch 'c-extension' into conard/elo-margin
Nov 23, 2023
94bd391
Use starting Elo for default tile weight engine weights
nhamil Nov 23, 2023
8b1907b
Allow estimated Elo override for tile weight engine default weights
nhamil Nov 23, 2023
2f9e577
Merge pull request #34 from nhamil/conard/elo-margin
maconard Nov 23, 2023
b0229a0
Add estimated Elo calculation
nhamil Nov 23, 2023
b63108d
Return nan when there are no results, fix type hint for elo delta list
nhamil Nov 24, 2023
b9ba6e8
Add Elo options for tournament
nhamil Nov 24, 2023
11fa898
Add erfinv implementation and remove scipy from requirements
nhamil Nov 24, 2023
62361ff
Add documentation for erfinv functions
nhamil Nov 24, 2023
49e776f
Merge pull request #37 from nhamil/nhamil/estimated-elo
nhamil Nov 24, 2023
663d472
Make move class
nhamil Nov 24, 2023
74fc409
Update pytest, fix C move/board functions
nhamil Nov 24, 2023
1f10098
Add move pickling
nhamil Nov 24, 2023
e3ea28e
Modify engines to use move properties
nhamil Nov 24, 2023
1e2b18b
Add move comparison and hashing
nhamil Nov 24, 2023
56db625
Update types and constants
nhamil Nov 27, 2023
cc1a0d4
Update C tilewe commit
nhamil Nov 28, 2023
067828b
Add wheel to dev requirements
nhamil Nov 28, 2023
686c46c
Change version to 0.0.2
nhamil Nov 28, 2023
64a118f
Update GitHub workflow
nhamil Nov 28, 2023
8e4d4c8
Checkout submodule in workflow
nhamil Nov 28, 2023
e7a13b7
Reduce line length
nhamil Nov 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
Expand All @@ -28,7 +30,7 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

# install the tilewe package locally
python -m pip install -e ./tilewe
python -m pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tmp/
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tilewe/src/tilewe"]
path = tilewe/src/tilewe
url = https://github.com/nhamil/tilewe
2 changes: 1 addition & 1 deletion example_tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def run_tournament():
tilewe.engine.RandomEngine(),
])

results = tournament.play(100, n_threads=multiprocessing.cpu_count(), move_seconds=15)
results = tournament.play(100, n_threads=multiprocessing.cpu_count(), move_seconds=1, elo_mode="estimated")

# print the result of game 1
print(results.match_data[0].board)
Expand Down
7 changes: 6 additions & 1 deletion tilewe/pyproject.toml → pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tilewe"
version = "0.0.1"
version = "0.0.2"
authors = [
{ name="Nicholas Hamilton", email="nh.contact.1@gmail.com" },
{ name="Michael Conard", email="michaelaconard314@gmail.com" },
Expand All @@ -16,3 +16,8 @@ classifiers = [

[project.urls]
"Github" = "https://github.com/nhamil/python-tilewe"
"C Implementation" = "https://github.com/nhamil/tilewe"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
wheel
flake8
pytest
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
numpy==1.26.2
24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from setuptools import setup, find_packages, Extension

ext_modules = [
Extension(
name="ctilewe",
sources=[
"tilewe/src/ctilewemodule.c",
"tilewe/src/tilewe/Source/Tilewe/Piece.c",
"tilewe/src/tilewe/Source/Tilewe/Tables.c"
],
include_dirs=[
"tilewe/src/tilewe/Source",
"tilewe/src/tilewe/Source/Tilewe"
],
extra_compile_args=["-O3", "-funroll-loops"]
)
]

setup(
name='tilewe',
version='0.0.2',
packages=find_packages(),
ext_modules=ext_modules
)
Loading