Nashpy 项目教程
NashpyA python library for 2 player games.项目地址:https://gitcode.com/gh_mirrors/na/Nashpy
1. 项目的目录结构及介绍
Nashpy 是一个用于处理2人游戏的Python库。以下是项目的目录结构及其介绍:
Nashpy/
├── benchmarks/
├── docs/
├── src/
│ └── nashpy/
├── tests/
│ └── unit/
├── .gitignore
├── .readthedocs.yml
├── CHANGES.md
├── CITATION.md
├── LICENSE
├── README.md
├── paper/
│ ├── paper.bib
│ └── paper.md
├── pyproject.toml
├── pytest.ini
├── tox.ini
- benchmarks/: 包含性能测试的文件。
- docs/: 包含项目的文档文件。
- src/nashpy/: 包含项目的主要源代码。
- tests/unit/: 包含单元测试文件。
- .gitignore: Git忽略文件。
- .readthedocs.yml: 用于Read the Docs的配置文件。
- CHANGES.md: 项目变更日志。
- CITATION.md: 项目引用信息。
- LICENSE: 项目许可证。
- README.md: 项目介绍和使用说明。
- paper/: 包含项目相关的论文文件。
- pyproject.toml: 项目构建配置文件。
- pytest.ini: Pytest配置文件。
- tox.ini: Tox配置文件。
2. 项目的启动文件介绍
Nashpy 项目的启动文件位于 src/nashpy/
目录下。主要的启动文件是 __init__.py
,它初始化了整个库并导入了必要的模块。
# src/nashpy/__init__.py
from .game import Game
from .learning import replicator_dynamics, fictitious_play
from .algorithms import support_enumeration, vertex_enumeration, lemke_howson
__all__ = [
'Game',
'replicator_dynamics',
'fictitious_play',
'support_enumeration',
'vertex_enumeration',
'lemke_howson'
]
3. 项目的配置文件介绍
Nashpy 项目的配置文件主要包括 pyproject.toml
和 tox.ini
。
pyproject.toml
pyproject.toml
文件用于配置项目的构建系统和其他相关设置。
[tool.poetry]
name = "nashpy"
version = "0.0.41"
description = "A Python library for 2 player games"
authors = ["Vincent Knight <vincent.knight@gmail.com>"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/drvinceknight/Nashpy"
documentation = "http://nashpy.readthedocs.io/"
[tool.poetry.dependencies]
python = "^3.6"
numpy = "^1.18"
scipy = "^1.4"
[tool.poetry.dev-dependencies]
pytest = "^5.4"
tox = "^3.15"
sphinx = "^3.0"
alabaster = "^0.7"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
tox.ini
tox.ini
文件用于配置自动化测试环境。
[tox]
envlist = py36, py37, py38
skipsdist = true
[testenv]
deps =
pytest
numpy
scipy
commands =
pytest
以上是 Nashpy 项目的基本教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。希望这些信息能帮助你更好地理解和使用 Nashpy 项目。
NashpyA python library for 2 player games.项目地址:https://gitcode.com/gh_mirrors/na/Nashpy