Skip to content

Commit 8acfa15

Browse files
committed
Rename qe_nfg_from_gam_file to from_gam
1 parent 0bdc14e commit 8acfa15

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

quantecon/game_theory/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
from .logitdyn import LogitDynamics
2525
from .polymatrix_game import PolymatrixGame
2626
from .howson_lcp import polym_lcp_solver
27-
from .game_converters import GAMReader, GAMWriter, qe_nfg_from_gam_file
27+
from .game_converters import GAMReader, GAMWriter, from_gam

quantecon/game_theory/game_converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
>>> import quantecon.game_theory as gt
1212
>>> filepath = os.path.dirname(gt.__file__)
1313
>>> filepath += "/tests/game_files/minimum_effort_game.gam"
14-
>>> nfg = gt.qe_nfg_from_gam_file(filepath)
14+
>>> nfg = gt.from_gam(filepath)
1515
>>> print(nfg)
1616
3-player NormalFormGame with payoff profile array:
1717
[[[[ 1., 1., 1.], [ 1., 1., -9.], [ 1., 1., -19.]],
@@ -203,7 +203,7 @@ def _dump(g):
203203
return s.rstrip()
204204

205205

206-
def qe_nfg_from_gam_file(filename: str) -> NormalFormGame:
206+
def from_gam(filename: str) -> NormalFormGame:
207207
"""
208208
Makes a QuantEcon Normal Form Game from a gam file.
209209

quantecon/game_theory/tests/test_howson_lcp.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import numpy as np
66
from numpy.testing import assert_, assert_allclose
7-
from quantecon.game_theory.game_converters import qe_nfg_from_gam_file
7+
from quantecon.game_theory.game_converters import from_gam
88
from quantecon.game_theory import (
99
Player,
1010
NormalFormGame,
@@ -22,7 +22,7 @@
2222

2323
def test_polym_lcp_solver_where_solution_is_pure_NE():
2424
filename = "big_polym.gam"
25-
nfg = qe_nfg_from_gam_file(os.path.join(data_dir, filename))
25+
nfg = from_gam(os.path.join(data_dir, filename))
2626
polymg = PolymatrixGame.from_nf(nfg)
2727
ne = polym_lcp_solver(polymg)
2828
worked = nfg.is_nash(ne)
@@ -31,7 +31,7 @@ def test_polym_lcp_solver_where_solution_is_pure_NE():
3131

3232
def test_polym_lcp_solver_where_lcp_solver_must_backtrack():
3333
filename = "triggers_back_case.gam"
34-
nfg = qe_nfg_from_gam_file(os.path.join(data_dir, filename))
34+
nfg = from_gam(os.path.join(data_dir, filename))
3535
polymg = PolymatrixGame.from_nf(nfg)
3636
ne = polym_lcp_solver(polymg)
3737
worked = nfg.is_nash(ne)
@@ -305,7 +305,7 @@ def test_solves_multiplayer_rps_like():
305305

306306
def test_different_starting():
307307
filename = "triggers_back_case.gam"
308-
nfg = qe_nfg_from_gam_file(os.path.join(data_dir, filename))
308+
nfg = from_gam(os.path.join(data_dir, filename))
309309
polymg = PolymatrixGame.from_nf(nfg)
310310
starting = [3, 2, 2, 0, 3]
311311
# We also notice that changing the start

quantecon/game_theory/tests/test_polymatrix_game.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
from numpy.testing import assert_, assert_raises
6-
from quantecon.game_theory.game_converters import qe_nfg_from_gam_file
6+
from quantecon.game_theory.game_converters import from_gam
77
from quantecon.game_theory import NormalFormGame, PolymatrixGame
88
from numpy import allclose, zeros
99

@@ -39,13 +39,13 @@ class TestPolymatrixGame():
3939
@classmethod
4040
def setup_class(cls):
4141
filename = "minimum_effort_game.gam"
42-
cls.non_pmg = qe_nfg_from_gam_file(
42+
cls.non_pmg = from_gam(
4343
os.path.join(data_dir, filename))
4444
filename = "big_polym.gam"
45-
cls.pmg1 = qe_nfg_from_gam_file(
45+
cls.pmg1 = from_gam(
4646
os.path.join(data_dir, filename))
4747
filename = "triggers_back_case.gam"
48-
cls.pmg2 = qe_nfg_from_gam_file(
48+
cls.pmg2 = from_gam(
4949
os.path.join(data_dir, filename))
5050
bimatrix = [[(54, 23), (72, 34)],
5151
[(92, 32), (34, 36)],

0 commit comments

Comments
 (0)