Skip to content

Commit b52e7cc

Browse files
committed
Merge branch 'issue_483' into integrate_llm
2 parents 25846d4 + 29e7234 commit b52e7cc

173 files changed

Lines changed: 2881 additions & 3080 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ Checks: |
77
-modernize-avoid-c-arrays,
88
-modernize-pass-by-value,
99
-modernize-use-nodiscard,
10-
-modernize-concat-nested-namespaces,
1110
cppcoreguidelines-pro-type-cstyle-cast,
1211
cppcoreguidelines-pro-type-member-init,
1312
cppcoreguidelines-prefer-member-initializer,
1413
misc-const-correctness
1514
WarningsAsErrors: '*'
16-
# Don't bother with wxWidgets headers
17-
HeaderFilterRegex: '^((?!labenski).)*$'
18-
AnalyzeTemporaryDtors: false
15+
HeaderFilterRegex: '.*'
1916
FormatStyle: none
2017
User: arbiter
2118
CheckOptions:

.github/workflows/python.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
1111
strategy:
1212
matrix:
13-
python-version: ['3.9', '3.12']
13+
python-version: ['3.9', '3.13']
1414

1515
steps:
1616
- uses: actions/checkout@v4
@@ -21,10 +21,10 @@ jobs:
2121
- name: Set up dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install setuptools cython pytest wheel lxml numpy scipy
24+
pip install setuptools build cython pytest pytest-skip-slow wheel lxml numpy scipy
2525
- name: Build source distribution
2626
run:
27-
python setup.py sdist
27+
python -m build
2828
- name: Build from source distribution
2929
run: |
3030
cd dist
@@ -37,7 +37,7 @@ jobs:
3737
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
3838
strategy:
3939
matrix:
40-
python-version: ['3.12']
40+
python-version: ['3.13']
4141

4242
steps:
4343
- uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
4848
- name: Set up dependencies
4949
run: |
5050
python -m pip install --upgrade pip
51-
pip install cython pytest wheel lxml numpy scipy
51+
pip install cython pytest pytest-skip-slow wheel lxml numpy scipy
5252
- name: Build extension
5353
run: |
5454
python -m pip install -v .
@@ -60,7 +60,7 @@ jobs:
6060
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
6161
strategy:
6262
matrix:
63-
python-version: ['3.12']
63+
python-version: ['3.13']
6464

6565
steps:
6666
- uses: actions/checkout@v4
@@ -71,7 +71,7 @@ jobs:
7171
- name: Set up dependencies
7272
run: |
7373
python -m pip install --upgrade pip
74-
pip install cython pytest wheel lxml numpy scipy
74+
pip install cython pytest pytest-skip-slow wheel lxml numpy scipy
7575
- name: Build extension
7676
run: |
7777
python -m pip install -v .
@@ -83,7 +83,7 @@ jobs:
8383
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
8484
strategy:
8585
matrix:
86-
python-version: ['3.12']
86+
python-version: ['3.13']
8787

8888
steps:
8989
- uses: actions/checkout@v4
@@ -94,7 +94,7 @@ jobs:
9494
- name: Set up dependencies
9595
run: |
9696
python -m pip install --upgrade pip
97-
pip install cython pytest wheel lxml numpy scipy
97+
pip install cython pytest pytest-skip-slow wheel lxml numpy scipy
9898
- name: Build extension
9999
run: |
100100
python -m pip install -v .

ChangeLog

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
## [16.4.0] - unreleased
44

5-
### Removed
5+
### General
6+
- Officially added support for Python 3.13.
67

8+
### Removed
79
- The deprecated functions `Game.read_game`, `Game.parse_game` and `Game.write` functions have
810
been removed as planned. (#357)
911

@@ -57,6 +59,12 @@
5759
Explorer, as GTE no longer reads files in this format.
5860

5961

62+
## [16.2.2] - unreleased
63+
64+
### Fixed
65+
- `Game.copy_tree` and `Game.move_tree` implementations reversed the roles of the
66+
`src` and `dest` nodes (#499)
67+
6068
## [16.2.1] - 2025-01-06
6169

6270
### Fixed
@@ -67,7 +75,6 @@
6775
- Attempting to call the default constructor on Game objects (rather than one of the factory
6876
functions) now raises a more informative exception (#463)
6977

70-
7178
## [16.2.0] - 2024-04-05
7279

7380
### Fixed

Makefile.am

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ EXTRA_DIST = \
245245
src/README.rst
246246

247247
core_SOURCES = \
248+
src/core/core.h \
249+
src/core/util.h \
248250
src/core/array.h \
249251
src/core/list.h \
250252
src/core/vector.h \
@@ -636,8 +638,7 @@ msw-msi:
636638
light -ext WixUIExtension gambit.wixobj
637639

638640
clang-tidy:
639-
clang-tidy ${top_srcdir}/src/core/*.cc -- --std=c++17 -I ${top_srcdir}/src -I ${top_srcdir}/src/labenski/include -DVERSION="" ${WX_CXXFLAGS}
640-
clang-tidy ${top_srcdir}/src/games/*.cc ${top_srcdir}/src/games/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -I ${top_srcdir}/src/labenski/include -DVERSION="" ${WX_CXXFLAGS}
641-
clang-tidy ${top_srcdir}/src/solvers/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -I ${top_srcdir}/src/labenski/include -DVERSION="" ${WX_CXXFLAGS}
642-
clang-tidy ${top_srcdir}/src/tools/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -I ${top_srcdir}/src/labenski/include -DVERSION="" ${WX_CXXFLAGS}
643-
clang-tidy ${top_srcdir}/src/gui/*.cc -- --std=c++17 -I ${top_srcdir}/src -I ${top_srcdir}/src/labenski/include -DVERSION="" ${WX_CXXFLAGS}
641+
clang-tidy ${top_srcdir}/src/core/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""
642+
clang-tidy ${top_srcdir}/src/games/*.cc ${top_srcdir}/src/games/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""
643+
clang-tidy ${top_srcdir}/src/solvers/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""
644+
clang-tidy ${top_srcdir}/src/tools/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""

pyproject.toml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
[build-system]
22
requires = ["setuptools", "wheel", "Cython"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "pygambit"
7+
version = "16.3.0"
8+
description = "The package for computation in game theory"
9+
readme = "src/README.rst"
10+
requires-python = ">=3.9"
11+
license = "GPL-2.0-or-later"
12+
authors = [
13+
{name = "Theodore Turocy", email = "ted.turocy@gmail.com"},
14+
{name = "Rahul Savani", email = "rahul.savani@liverpool.ac.uk"}
15+
]
16+
keywords = ["game theory", "Nash equilibrium"]
17+
classifiers=[
18+
"Development Status :: 5 - Production/Stable",
19+
"Intended Audience :: Science/Research",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Programming Language :: Python :: Implementation :: CPython",
26+
"Topic :: Scientific/Engineering :: Mathematics"
27+
]
28+
dependencies = [
29+
"numpy",
30+
"scipy",
31+
]
32+
33+
[project.urls]
34+
Homepage = "https://www.gambit-project.org"
35+
Documentation = "https://gambitproject.readthedocs.io"
36+
Repository = "https://github.com/gambitproject/gambit.git"
37+
Issues = "https://github.com/gambitproject/gambit/issues"
38+
Changelog = "https://github.com/gambitproject/gambit/blob/master/ChangeLog"
39+
340

441
[tool.ruff]
542
line-length = 99
@@ -33,3 +70,16 @@ indent-style = "space"
3370

3471
[tool.cython-lint]
3572
max-line-length = 99
73+
74+
75+
[tool.pytest.ini_options]
76+
addopts = "--strict-markers"
77+
markers = [
78+
"nash_enummixed_strategy: tests of enummixed_solve in strategies",
79+
"nash_lcp_strategy: tests of lcp_solve in strategies",
80+
"nash_lcp_behavior: tests of lcp_solve in behaviors",
81+
"nash_lp_strategy: tests of lp_solve in strategies",
82+
"nash_lp_behavior: tests of lp_solve in behaviors",
83+
"nash: all tests of Nash equilibrium solvers",
84+
"slow: all time-consuming tests",
85+
]

setup.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -99,44 +99,7 @@ def solver_library_config(library_name: str, paths: list) -> tuple:
9999
)
100100
)
101101

102-
103-
def readme():
104-
with open("src/README.rst") as f:
105-
return f.read()
106-
107-
108102
setuptools.setup(
109-
name="pygambit",
110-
version="16.3.0",
111-
description="The package for computation in game theory",
112-
long_description=readme(),
113-
classifiers=[
114-
"Development Status :: 5 - Production/Stable",
115-
"Intended Audience :: Science/Research",
116-
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
117-
"Programming Language :: Python :: 3.9",
118-
"Programming Language :: Python :: 3.10",
119-
"Programming Language :: Python :: 3.11",
120-
"Programming Language :: Python :: 3.12",
121-
"Programming Language :: Python :: Implementation :: CPython",
122-
"Topic :: Scientific/Engineering :: Mathematics"
123-
],
124-
keywords="game theory Nash equilibrium",
125-
license="GPL2+",
126-
author="Theodore Turocy",
127-
author_email="ted.turocy@gmail.com",
128-
url="https://www.gambit-project.org",
129-
project_urls={
130-
"Documentation": "https://gambitproject.readthedocs.io/",
131-
"Source": "https://github.com/gambitproject/gambit",
132-
"Tracker": "https://github.com/gambitproject/gambit/issues",
133-
},
134-
python_requires=">=3.9",
135-
install_requires=[
136-
"numpy",
137-
"scipy",
138-
"deprecated",
139-
],
140103
libraries=[cppgambit_bimatrix, cppgambit_liap, cppgambit_logit, cppgambit_simpdiv,
141104
cppgambit_gtracer, cppgambit_enumpoly,
142105
cppgambit_games, cppgambit_core],

src/core/array.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This file is part of Gambit
33
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
44
//
5-
// FILE: src/libgambit/array.h
5+
// FILE: src/core/array.h
66
// A basic bounds-checked array type
77
//
88
// This program is free software; you can redistribute it and/or modify
@@ -20,12 +20,14 @@
2020
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2121
//
2222

23-
#ifndef LIBGAMBIT_ARRAY_H
24-
#define LIBGAMBIT_ARRAY_H
23+
#ifndef GAMBIT_CORE_ARRAY_H
24+
#define GAMBIT_CORE_ARRAY_H
2525

2626
#include <vector>
2727
#include <iterator>
2828

29+
#include "util.h"
30+
2931
namespace Gambit {
3032

3133
/// \brief An extension of std::vector to have arbitrary offset index
@@ -282,4 +284,4 @@ template <class T> void erase_atindex(Array<T> &p_array, int p_index)
282284

283285
} // end namespace Gambit
284286

285-
#endif // LIBGAMBIT_ARRAY_H
287+
#endif // GAMBIT_CORE_ARRAY_H

src/core/core.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// This file is part of Gambit
3+
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
4+
//
5+
// FILE: src/core/core.h
6+
// Core (game theory-independent) declarations and utilities for Gambit
7+
//
8+
// This program is free software; you can redistribute it and/or modify
9+
// it under the terms of the GNU General Public License as published by
10+
// the Free Software Foundation; either version 2 of the License, or
11+
// (at your option) any later version.
12+
//
13+
// This program is distributed in the hope that it will be useful,
14+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
// GNU General Public License for more details.
17+
//
18+
// You should have received a copy of the GNU General Public License
19+
// along with this program; if not, write to the Free Software
20+
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21+
//
22+
23+
#ifndef GAMBIT_CORE_CORE_H
24+
#define GAMBIT_CORE_CORE_H
25+
26+
#include "util.h"
27+
#include "array.h"
28+
#include "list.h"
29+
#include "recarray.h"
30+
#include "vector.h"
31+
#include "matrix.h"
32+
#include "rational.h"
33+
34+
#endif // GAMBIT_CORE_CORE_H

0 commit comments

Comments
 (0)