Skip to content

Commit

Permalink
copy paste the os path join stuff into polymatrix tests. perhaps we s…
Browse files Browse the repository at this point in the history
…hould put the path stuff in some utils place.
  • Loading branch information
GautamsGitHub committed Nov 12, 2024
1 parent 79f74cb commit ac5fa26
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions quantecon/game_theory/tests/test_polymatrix_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
from itertools import product
from numpy import isclose

import os

# Mimicing quantecon.tests.util.get_data_dir
data_dir_name = "gam_files"
this_dir = os.path.dirname(__file__)
data_dir = os.path.join(this_dir, data_dir_name)

def close_normal_form_games(
nf1: NormalFormGame,
Expand All @@ -33,8 +39,8 @@ def close_normal_form_games(


def test_normal_form_to_polymatrix_to_normal_form():
filename = "gam_files/big_polym.gam"
nfg = qe_nfg_from_gam_file(filename)
filename = "big_polym.gam"
nfg = qe_nfg_from_gam_file(os.path.join(data_dir, filename))
polym = PolymatrixGame.from_nf(nfg, is_polymatrix=True)
back_in_nf = polym.to_nf()
are_close = close_normal_form_games(nfg, back_in_nf)
Expand Down

0 comments on commit ac5fa26

Please sign in to comment.