Closed cvanelteren closed 1 year ago
Hi @cvanelteren, I'm going to need more info from you. But first let me explain what I think may be going on:
1) If you install from PyPi (with pip) you don't need to compile the library, it is already pre-compiled, and you should be able to use it as is. What may happen is that there are no available version of egttools
compatible with your arch linux (I'm not sure, I never compiled for arch since it's hard to know which version of system libraries you may have).
2) If you compile the library yourself, I recommend not using the developer mode (unless you are planning to make changes to the library itself). Try the same process but with pip install [path to the library root folder
instead of pip install -e [path to the library root folder
. Also, I recommend that you first install all the requirements in anaconda (that is, numpy
, scipy
, matplotlib
, networkx
and seaborn
, before building. And I also don't recommend you do this on the base environment, but rather, create a new anaconda environment for your build (I recommend using python 3.9 or 3.10).
3) Can you post the matplotlib incompatibility error you get?
Now the extra info I need from you:
a) I need the version of egttools you are using. If you installed from PiPy, then you can do egttools.VERSION
to check which version you have.
b) If you have cloned the repository, I need the commit identifier and which branch you are using.
c) You should post the full output of the building process so that I can see what is going on and why the numerical package is not being built.
Hope this helps. (btw, in the next few weeks I'll release a new version of the library)
If you compile the library yourself, I recommend not using the developer mode (unless you are planning to make changes to the library itself)
I was planning on changing the mpl error. The dependencies are installed as listed in the readme (including boost, eigen, OpenBLAS etc)
The commit I was using is the latest (d1ce88f3098bc25482d105017d0ae9984c000195).
Alright. I never built for Python 3.11, but it does seems like it works. Under the EGTTools folder a folder called skbuild should have been created. Since you are installing it in development mode (with the -e), then you need to copy the `numerical.cpython-311-x86_64-linux-gnu.soto the folder
EGTTools/src/egttools/numerical/` folder. In the past this used to happen automatically, but at some point it stopped and I don't know why.
Regarding the MPL issue, it would be cool if you could take a look at eat. I think I managed to fix it by building against the anaconda version of OpenMP and changing the linking so that it is dynamic - target_link_libraries(numerical_ PUBLIC OpenMP::OpenMP_CXX)
. I just need to add to the requirements of anaconda builds that OpenMP is installed, and to create a separate build for PyPi which does include OpenMP. I think this is what Scipy does
This works, cool beans. Was hoping it was a simple so
was missing. Should I leave it open until the next version it gets fixed?
Yeah you can leave it open for now. I'll try to fix it before the end of the week.
I'm closing this issue as I'll be releasing a patch with your updates today. I'll open a new issue to create plots for the network simulations
Great! Let me know when you are ready to work on the networkx visualizations.
Great! Let me know when you are ready to work on the networkx visualizations.
Let's discuss next week when I am back from a conference then.
Describe the bug It seems like pip is not able to find some of the compiled parts of the module. I follow the instructions from the build page. The package works when installing from pip without building, but then produces another error not listed here (regarding a matplotlib incompability).
Traceback
``` Traceback (most recent call last): File "/home/casper/projects/EGTTools/src/egttools/numerical/__init__.py", line 4, inTo Reproduce Steps to reproduce the behavior:
Write some test code
``` python # test. py import numpy as np from egttools.analytical import PairwiseComparison from egttools.games import Matrix2PlayerGameHolder beta = 1; Z = 100; nb_strategies = 2; A = np.array([[-0.5, 2.], [0., 0.]]) pop_states = np.arange(0, Z + 1, 1) game = Matrix2PlayerGameHolder(nb_strategies, payoff_matrix=A) # Instantiate evolver and calculate gradient evolver = PairwiseComparison(population_size=Z, game=game) gradients = np.array([evolver.calculate_gradient_of_selection(beta, np.array([x, Z - x])) for x in range(Z + 1)]) from egttools.plotting import plot_gradients plot_gradients(gradients, figsize=(4, 4), fig_title="Hawk-Dove game stochastic dynamics", marker_facecolor='white', xlabel="frequency of hawks (k/Z)", marker="o", marker_size=20, marker_plot_freq=2) ```install the package using instructions
```conda activate base && python -m build && pip install -e . && python test.py```Expected behavior Run the example scripts and output a figure
Desktop (please complete the following information):