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

add freqAnalyzer strategy #1444

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

miller-ian
Copy link
Contributor

No description provided.

@miller-ian miller-ian marked this pull request as draft July 5, 2024 22:49
@drvinceknight
Copy link
Member

The test failures don't seem to be related to your contribution.

For example:

  Expected:
      Axelrod game: (R,P,S,T) = (3, 1, 0, 5)
  Got:
      Axelrod game: (R,P,S,T) = (np.int64(3), np.int64(1), np.int64(0), np.int64(5))
  

I'd still like to investigate what is happening here though. I wonder if this could be related to numpy's 2.0.0 release.

Here's what tox has installed (indeed numpy==2.0.0).

py311: attrs==23.2.0,Axelrod @ file:///home/runner/work/Axelrod/Axelrod/.tox/.tmp/package/1/axelrod-4.14.0.tar.gz#sha256=4b519abc1589884bdc18d5eaf0f4240bf8d1a3681b080e92b0df52dd62ef4a11,black==24.4.2,click==8.1.7,cloudpickle==3.0.0,contourpy==1.2.1,coverage==7.5.4,cycler==0.12.1,dask==2024.7.0,dask-expr==1.1.7,fonttools==4.53.1,fsspec==2024.6.1,hypothesis==6.105.0,importlib_metadata==8.0.0,iniconfig==2.0.0,isort==5.13.2,kiwisolver==1.4.5,locket==1.0.0,matplotlib==3.9.1,mypy-extensions==1.0.0,numpy==2.0.0,packaging==24.1,pandas==2.2.2,partd==1.4.2,pathspec==0.12.1,pillow==10.4.0,pip==24.1,platformdirs==4.2.2,pluggy==1.5.0,pyarrow==16.1.0,pyparsing==3.1.2,pytest==8.2.2,pytest-cov==5.0.0,pytest-randomly==3.15.0,pytest-sugar==1.0.0,python-dateutil==2.9.0.post0,pytz==2024.1,PyYAML==6.0.1,scipy==1.14.0,setuptools==70.1.0,six==1.16.0,sortedcontainers==2.4.0,termcolor==2.4.0,toolz==0.12.1,tqdm==4.66.4,tzdata==2024.1,wheel==0.43.0,zipp==3.19.2

@miller-ian
Copy link
Contributor Author

The test failures don't seem to be related to your contribution.

For example:

  Expected:
      Axelrod game: (R,P,S,T) = (3, 1, 0, 5)
  Got:
      Axelrod game: (R,P,S,T) = (np.int64(3), np.int64(1), np.int64(0), np.int64(5))
  

I'd still like to investigate what is happening here though. I wonder if this could be related to numpy's 2.0.0 release.

Here's what tox has installed (indeed numpy==2.0.0).

py311: attrs==23.2.0,Axelrod @ file:///home/runner/work/Axelrod/Axelrod/.tox/.tmp/package/1/axelrod-4.14.0.tar.gz#sha256=4b519abc1589884bdc18d5eaf0f4240bf8d1a3681b080e92b0df52dd62ef4a11,black==24.4.2,click==8.1.7,cloudpickle==3.0.0,contourpy==1.2.1,coverage==7.5.4,cycler==0.12.1,dask==2024.7.0,dask-expr==1.1.7,fonttools==4.53.1,fsspec==2024.6.1,hypothesis==6.105.0,importlib_metadata==8.0.0,iniconfig==2.0.0,isort==5.13.2,kiwisolver==1.4.5,locket==1.0.0,matplotlib==3.9.1,mypy-extensions==1.0.0,numpy==2.0.0,packaging==24.1,pandas==2.2.2,partd==1.4.2,pathspec==0.12.1,pillow==10.4.0,pip==24.1,platformdirs==4.2.2,pluggy==1.5.0,pyarrow==16.1.0,pyparsing==3.1.2,pytest==8.2.2,pytest-cov==5.0.0,pytest-randomly==3.15.0,pytest-sugar==1.0.0,python-dateutil==2.9.0.post0,pytz==2024.1,PyYAML==6.0.1,scipy==1.14.0,setuptools==70.1.0,six==1.16.0,sortedcontainers==2.4.0,termcolor==2.4.0,toolz==0.12.1,tqdm==4.66.4,tzdata==2024.1,wheel==0.43.0,zipp==3.19.2

Yep, looks like numpy installation is the issue. I'm seeing this error in my local jupyter notebook I'm using for testing:

File ~/Library/Python/3.9/lib/python/site-packages/matplotlib/transforms.py:49
     [46](https://file+.vscode-resource.vscode-cdn.net/Users/ianmiller/sources/projects/Axelrod/~/Library/Python/3.9/lib/python/site-packages/matplotlib/transforms.py:46) from numpy.linalg import inv
     [48](https://file+.vscode-resource.vscode-cdn.net/Users/ianmiller/sources/projects/Axelrod/~/Library/Python/3.9/lib/python/site-packages/matplotlib/transforms.py:48) from matplotlib import _api
---> [49](https://file+.vscode-resource.vscode-cdn.net/Users/ianmiller/sources/projects/Axelrod/~/Library/Python/3.9/lib/python/site-packages/matplotlib/transforms.py:49) from matplotlib._path import (
     [50](https://file+.vscode-resource.vscode-cdn.net/Users/ianmiller/sources/projects/Axelrod/~/Library/Python/3.9/lib/python/site-packages/matplotlib/transforms.py:50)     affine_transform, count_bboxes_overlapping_bbox, update_path_extents)
     [51](https://file+.vscode-resource.vscode-cdn.net/Users/ianmiller/sources/projects/Axelrod/~/Library/Python/3.9/lib/python/site-packages/matplotlib/transforms.py:51) from .path import Path
     [53](https://file+.vscode-resource.vscode-cdn.net/Users/ianmiller/sources/projects/Axelrod/~/Library/Python/3.9/lib/python/site-packages/matplotlib/transforms.py:53) DEBUG = False

ImportError: numpy.core.multiarray failed to import

New numpy release is incompatible with older version of matplotlib and for some reason, pip's dependency resolver wasn't working properly. I was able to resolve locally by upgrading pip, numpy, and matplotlib.

@miller-ian miller-ian mentioned this pull request Jul 11, 2024
@marcharper
Copy link
Member

A few tests are failing:

  • one in the docs that counts total strategies of various types
  • one involving the name / repr of your strategy
  • lines 89 and 93 are uncovered

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.

3 participants