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 a long-run strategy to the filtering test #1359

Merged
merged 4 commits into from
Aug 7, 2020
Merged

Add a long-run strategy to the filtering test #1359

merged 4 commits into from
Aug 7, 2020

Conversation

caddycarine
Copy link
Contributor

Currently test_boolean_filtering only uses strategies as given by the strategy_list hypothesis strategy. This by default only picks short run time strategies so we are not ensuring that the long run filter works.

CaddyC added 2 commits August 4, 2020 14:30
Currently `test_boolean_filtering` only uses strategies as given by the `strategy_list` hypothesis strategy. This by default only picks short run time strategies so we are not ensuring that the long run filter works.
* 'master' of github.com:caddycarine/Axelrod:
  Update citations.md
@Nikoleta-v3
Copy link
Member

Hello @caddycarine 👋 Thank you for the PR. Nice catch that the long run strategies are currently not included in the test.

The DBS strategy is indeed a long run strategy but Cooperator is not. Cooperator is actually included in the strategy_list.

Note that you can see the list of the long run strategies using the following code:

>>> import axelrod as axl

>>> filterset = {
...    "long_run_time": True
...    }

>>> strategies = axl.filtered_strategies(filterset)
>>> strategies

which is based on this page of the tutorial: https://axelrod.readthedocs.io/en/stable/tutorials/advanced/classification_of_strategies.html?highlight=classifier 😄 hope this helps.

@drvinceknight
Copy link
Member

I think that's wanted behaviour here @Nikoleta-v3, this test is checking that if you pass a list of strategies, some of which are long run time then the filter will pick the long run time ones out. Whether or not cooperator is long run time is not terribly important, it just needed an example with at least 1 long run time strategy. Am I missing something?

@drvinceknight
Copy link
Member

drvinceknight commented Aug 4, 2020

@caddycarine the tests are currently failing but this is not anything you've done (probably a dependency that's been upgraded upstream). Could you modify the /docs/tutorials/advanced/tournament_results.rst file, specifically where it says:

    >>> results.initial_cooperation_count
     [9.0, 0.0, 9.0, 9.0]

could you change that to:

    >>> results.initial_cooperation_count
     [9, 0, 9, 9]

Once you've done that, commit the change and push (like we did together), this will update things here.

@Nikoleta-v3
Copy link
Member

Ah of course 🤦‍♀️ Thank you for the clarification @drvinceknight

@marcharper
Copy link
Member

This also happened on #1288, it may be a dask or pandas issue with int vs float types.

Last PR failed checks, probably due to an int vs float issue in the dependencies.
@drvinceknight
Copy link
Member

Thanks for making that change @caddycarine, the tests have failed for another reason but this is not your fault. Can you modify the .github/workflows/config.yml file so that:

    - name: Check imports are sorted
       run: |
         python -m pip install isort
         python -m isort --check-only

becomes:

    - name: Check imports are sorted
       run: |
         python -m pip install "isort==4.3.21"
         python -m isort --check-only --recursive axelrod/.

Once you've done that commit and push as before :)

Specified isort version dependency to facilitate checks during commit.
@marcharper
Copy link
Member

Since all the tests pass, I think this is fine to go in as is. We'll rerun isort and black once #1288 goes in, and we'll have a script to run for all this once #1360 is done.

@Nikoleta-v3 Nikoleta-v3 self-requested a review August 7, 2020 12:05
@Nikoleta-v3 Nikoleta-v3 merged commit c89df5f into Axelrod-Python:master Aug 7, 2020
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.

5 participants