Refactor chesspp module with pyproject
This commit is contained in:
9
main.py
9
main.py
@@ -1,11 +1,10 @@
|
||||
import chess
|
||||
import chess.engine
|
||||
import chess.pgn
|
||||
from chesspp.classic_mcts import ClassicMcts
|
||||
from chesspp import engine
|
||||
from chesspp import eval
|
||||
from chesspp import util
|
||||
from chesspp import simulation
|
||||
from src.chesspp.classic_mcts import ClassicMcts
|
||||
from src.chesspp import engine
|
||||
from src.chesspp import util
|
||||
from src.chesspp import simulation, eval
|
||||
|
||||
|
||||
def test_simulate():
|
||||
|
||||
13
pyproject.toml
Normal file
13
pyproject.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[build-system]
|
||||
requires = ["setuptools >= 61.0"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "chess-pp"
|
||||
version = "0.1"
|
||||
dependencies = [
|
||||
"chess==1.10.0",
|
||||
"numpy==1.26.3",
|
||||
"stockfish==3.28.0",
|
||||
]
|
||||
requires-python = ">= 3.10"
|
||||
0
src/chesspp/__init__.py
Normal file
0
src/chesspp/__init__.py
Normal file
@@ -1,10 +1,12 @@
|
||||
import chess
|
||||
import random
|
||||
import eval
|
||||
import util
|
||||
import numpy as np
|
||||
|
||||
|
||||
from chesspp import eval
|
||||
from chesspp import util
|
||||
|
||||
|
||||
class ClassicMcts:
|
||||
|
||||
def __init__(self, board: chess.Board, color: chess.Color, parent=None, move: chess.Move | None = None,
|
||||
@@ -1,9 +1,10 @@
|
||||
from abc import ABC, abstractmethod
|
||||
import chess
|
||||
import chess.engine
|
||||
from classic_mcts import ClassicMcts
|
||||
import random
|
||||
|
||||
from chesspp.classic_mcts import ClassicMcts
|
||||
|
||||
|
||||
class Engine(ABC):
|
||||
color: chess.Color
|
||||
@@ -1,7 +1,7 @@
|
||||
import chess
|
||||
from abc import ABC, abstractmethod
|
||||
from i_strategy import IStrategy
|
||||
from typing import Dict
|
||||
from chesspp.i_strategy import IStrategy
|
||||
|
||||
|
||||
class IMcts(ABC):
|
||||
@@ -1,6 +1,7 @@
|
||||
from lichess_bot.lib.engine_wrapper import MinimalEngine, MOVE
|
||||
import chess.engine
|
||||
import engine
|
||||
|
||||
from chesspp import engine
|
||||
|
||||
|
||||
class ProbStockfish(MinimalEngine):
|
||||
@@ -6,7 +6,7 @@ from typing import Tuple, List
|
||||
from enum import Enum
|
||||
from dataclasses import dataclass
|
||||
|
||||
from engine import Engine
|
||||
from chesspp.engine import Engine
|
||||
|
||||
|
||||
class Winner(Enum):
|
||||
Reference in New Issue
Block a user