Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player, NormalFormGame: Make payoff_array's C contiguous #265

Merged
merged 3 commits into from
Nov 14, 2016
Merged

Conversation

oyamad
Copy link
Member

@oyamad oyamad commented Oct 20, 2016

Make payoff_array's C contiguous when when a payoff_profile_array is passed to NormalFormGame, in order for Numba not to complain.

@oyamad
Copy link
Member Author

oyamad commented Oct 20, 2016

The errors occur with Numba 0.29.0, but not with 0.28.1 or 0.26.0.

@sglyon
Copy link
Member

sglyon commented Oct 20, 2016

Sorry, I didn't quite follow.

Does this change-set fix the errors on all versions of numba, or do we still have issues on 0.29?

@oyamad
Copy link
Member Author

oyamad commented Oct 20, 2016

Sorry for not being clear.

  • The errors from Travis CI are not related to this PR. They are from random/utilities.py and lss.py. Those errors only occur with the latest Numba.
  • What this PR does is to make all the NormalFormGame.players[i].payoff_array's C contiguous, where there is no point of having a non-contiguous numpy array, and there is indeed a case (in some code I am currently writing) that passing a tuple of a C-contiguous array and a F-contiguous array does a bad thing making Numba complain (which has nothing to do with the errors here).

@oyamad
Copy link
Member Author

oyamad commented Oct 20, 2016

For the error from random/utilities.py, I filed an issue numba/numba#2159. I haven't investigated for the one from lss.py.

@oyamad
Copy link
Member Author

oyamad commented Oct 21, 2016

Opened numba/numba#2169 for the error from lss.py.

In fact, this error can be avoided by removing A = np.asarray(A) assuming that the input A is already an np.array, which allows us to have nopython=True for @jit.

@oyamad oyamad changed the title NormalFormGame: Make payoff_array's C contiguous Player: Make payoff_array C contiguous Oct 27, 2016
@oyamad
Copy link
Member Author

oyamad commented Oct 27, 2016

I changed the patch (and made a forced push), where order='C' is now applied when instantiating a Player.

@oyamad oyamad changed the title Player: Make payoff_array C contiguous Player, NormalFormGame: Make payoff_array's C contiguous Oct 28, 2016
@oyamad
Copy link
Member Author

oyamad commented Oct 28, 2016

Let me bring the previous commit back...

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 86.674% when pulling e4c633b on nfg_fix into 6da6bfe on master.

@oyamad
Copy link
Member Author

oyamad commented Nov 10, 2016

Rebased on master. This is ready to merge.

@mmcky
Copy link
Contributor

mmcky commented Nov 14, 2016

Thanks @oyamad merging this into master now.

@mmcky mmcky merged commit 43ecfa3 into master Nov 14, 2016
@mmcky mmcky deleted the nfg_fix branch November 14, 2016 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants